Merge pull request #1527 from prashant-webkul/development

Development
This commit is contained in:
Jitendra Singh 2019-09-26 17:07:16 +05:30 committed by GitHub
commit 04c93e2339
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 34 additions and 35 deletions

View File

@ -100,7 +100,6 @@ class CustomerController extends Controller
public function store()
{
$this->validate(request(), [
'channel_id' => 'required',
'first_name' => 'string|required',
'last_name' => 'string|required',
'gender' => 'required',
@ -156,7 +155,6 @@ class CustomerController extends Controller
public function update(Request $request, $id)
{
$this->validate(request(), [
'channel_id' => 'required',
'first_name' => 'string|required',
'last_name' => 'string|required',
'gender' => 'required',

View File

@ -78,17 +78,6 @@
@endforeach
</select>
</div>
<div class="control-group" :class="[errors.has('channel_id') ? 'has-error' : '']">
<label for="channel" >{{ __('admin::app.customers.customers.channel_name') }}</label>
<select class="control" name="channel_id" v-validate="'required'" data-vv-as="&quot;{{ __('shop::app.customers.customers.channel_name') }}&quot;">
@foreach ($channelName as $channel)
<option value="{{ $channel->id }}"> {{ $channel->name}} </>
@endforeach
</select>
<span class="control-error" v-if="errors.has('channel_id')">@{{ errors.first('channel_id') }}</span>
</div>
</div>
</div>
</form>

View File

@ -102,26 +102,6 @@
@endforeach
</select>
</div>
<div class="control-group" :class="[errors.has('channel_id') ? 'has-error' : '']">
<label for="channel" >{{ __('admin::app.customers.customers.channel_name') }}</label>
@if (! is_null($customer->channel_id))
<?php $selectedChannelOption = $customer->channel_id ?>
@else
<?php $selectedChannelOption = $customer->channel_id ?>
@endif
<select class="control" name="channel_id" v-validate="'required'" data-vv-as="&quot;{{ __('shop::app.customers.customers.channel_name') }}&quot;">
@foreach ($channelName as $channel)
<option value="{{ $channel->id }}" {{ $selectedChannelOption == $channel->id ? 'selected' : '' }}>
{{ $channel->name}}
</option>
@endforeach
</select>
<span class="control-error" v-if="errors.has('channel_id')">@{{ errors.first('channel_id') }}</span>
</div>
</div>
</accordian>

View File

@ -0,0 +1,34 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class RemoveChannelIdFromCustomersTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('customers', function (Blueprint $table) {
$table->dropForeign('customers_channel_id_foreign');
$table->dropColumn('channel_id');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('customers', function (Blueprint $table) {
$table->integer('channel_id')->unsigned();
$table->foreign('channel_id')->references('id')->on('channels')->onDelete('restrict');
});
}
}

View File

@ -68,8 +68,6 @@ class RegistrationController extends Controller
$data['password'] = bcrypt($data['password']);
$data['channel_id'] = core()->getCurrentChannel()->id;
if (core()->getConfigData('customer.settings.email.verification')) {
$data['is_verified'] = 0;
} else {