diff --git a/packages/Webkul/Admin/src/Http/routes.php b/packages/Webkul/Admin/src/Http/routes.php index ffa52dcad..12685443f 100644 --- a/packages/Webkul/Admin/src/Http/routes.php +++ b/packages/Webkul/Admin/src/Http/routes.php @@ -315,4 +315,50 @@ Route::group(['middleware' => ['web']], function () { ])->name('admin.sliders.store'); }); }); + + + //customer routes starts here + Route::prefix('customer')->group(function () { + + // Login Routes + Route::get('login', 'Webkul\Customer\Http\Controllers\SessionController@show')->defaults('_config', [ + 'view' => 'shop::customers.session.index', + ])->name('customer.session.index'); + + Route::post('login', 'Webkul\Customer\Http\Controllers\SessionController@create')->defaults('_config', [ + 'redirect' => 'customer.account.profile' + ])->name('customer.session.create'); + + + // Registration Routes + Route::get('register', 'Webkul\Customer\Http\Controllers\RegistrationController@show')->defaults('_config', [ + 'view' => 'shop::customers.signup.index' //hint path + ])->name('customer.register.index'); + + Route::post('register', 'Webkul\Customer\Http\Controllers\RegistrationController@create')->defaults('_config', [ + 'redirect' => 'customer.account.profile', + ])->name('customer.register.create'); //redirect attribute will get changed immediately to account.index when account's index page will be made + + // Auth Routes + Route::group(['middleware' => ['customer']], function () { + + //route for logout which will be under the auth guard of the customer by default + Route::get('logout', 'Webkul\Customer\Http\Controllers\SessionController@destroy')->defaults('_config', [ + 'redirect' => 'customer.session.index' + ])->name('customer.session.destroy'); + + //customer account + Route::prefix('account')->group(function () { + Route::get('profile', 'Webkul\Customer\Http\Controllers\CustomerController@profile')->defaults('_config', [ + 'view' => 'shop::customers.account.profile.home.index' + ])->name('customer.account.profile'); + + //profile edit + Route::get('profile/edit', 'Webkul\Customer\Http\Controllers\CustomerController@editProfile')->defaults('_config', [ + 'view' => 'shop::customers.account.profile.edit.index' + ])->name('customer.profile.edit'); + }); + }); + }); + //customer routes end here }); diff --git a/packages/Webkul/Customer/src/Database/migrations/2018_07_24_082930_create_customers_table.php b/packages/Webkul/Customer/src/Database/migrations/2018_07_24_082930_create_customers_table.php index 4802955de..7713f96a0 100644 --- a/packages/Webkul/Customer/src/Database/migrations/2018_07_24_082930_create_customers_table.php +++ b/packages/Webkul/Customer/src/Database/migrations/2018_07_24_082930_create_customers_table.php @@ -18,7 +18,7 @@ class CreateCustomersTable extends Migration $table->string('first_name'); $table->string('last_name'); $table->enum('gender', ['Male', 'Female']); - $table->date('date_of_birth'); + $table->date('date_of_birth')->nullable(); $table->string('phone')->unique()->nullable(); $table->string('email')->unique(); $table->string('password'); diff --git a/packages/Webkul/Customer/src/Http/routes.php b/packages/Webkul/Customer/src/Http/routes.php deleted file mode 100644 index 65dd874ef..000000000 --- a/packages/Webkul/Customer/src/Http/routes.php +++ /dev/null @@ -1,46 +0,0 @@ - ['web']], function () { - Route::prefix('customer')->group(function () { - - // Login Routes - Route::get('login', 'Webkul\Customer\Http\Controllers\SessionController@show')->defaults('_config', [ - 'view' => 'shop::customers.session.index', - ])->name('customer.session.index'); - - Route::post('login', 'Webkul\Customer\Http\Controllers\SessionController@create')->defaults('_config', [ - 'redirect' => 'customer.account.profile' - ])->name('customer.session.create'); - - - // Registration Routes - Route::get('register', 'Webkul\Customer\Http\Controllers\RegistrationController@show')->defaults('_config', [ - 'view' => 'shop::customers.signup.index' //hint path - ])->name('customer.register.index'); - - Route::post('register', 'Webkul\Customer\Http\Controllers\RegistrationController@create')->defaults('_config', [ - 'redirect' => 'customer.account.profile', - ])->name('customer.register.create'); //redirect attribute will get changed immediately to account.index when account's index page will be made - - // Auth Routes - Route::group(['middleware' => ['customer']], function () { - - //route for logout which will be under the auth guard of the customer by default - Route::get('logout', 'Webkul\Customer\Http\Controllers\SessionController@destroy')->defaults('_config', [ - 'redirect' => 'customer.session.index' - ])->name('customer.session.destroy'); - - //customer account - Route::prefix('account')->group(function () { - Route::get('profile', 'Webkul\Customer\Http\Controllers\CustomerController@profile')->defaults('_config', [ - 'view' => 'shop::customers.account.profile.home.index' - ])->name('customer.account.profile'); - - //profile edit - Route::get('profile/edit', 'Webkul\Customer\Http\Controllers\CustomerController@editProfile')->defaults('_config', [ - 'view' => 'shop::customers.account.profile.edit.index' - ])->name('customer.profile.edit'); - }); - }); - }); -}); diff --git a/packages/Webkul/Customer/src/Providers/CustomerServiceProvider.php b/packages/Webkul/Customer/src/Providers/CustomerServiceProvider.php index 0749c8f21..e6109be99 100644 --- a/packages/Webkul/Customer/src/Providers/CustomerServiceProvider.php +++ b/packages/Webkul/Customer/src/Providers/CustomerServiceProvider.php @@ -13,7 +13,7 @@ class CustomerServiceProvider extends ServiceProvider { public function boot(Router $router) { - include __DIR__ . '/../Http/routes.php'; + // include __DIR__ . '/../Http/routes.php'; $this->publishes([ __DIR__ . '/../../publishable/assets' => public_path('vendor/webkul/customer/assets'), diff --git a/packages/Webkul/Shop/src/Resources/assets/js/components/category-item.vue b/packages/Webkul/Shop/src/Resources/assets/js/components/category-item.vue index 2ffceecc3..e072840f4 100644 --- a/packages/Webkul/Shop/src/Resources/assets/js/components/category-item.vue +++ b/packages/Webkul/Shop/src/Resources/assets/js/components/category-item.vue @@ -1,7 +1,7 @@