47 lines
2.2 KiB
PHP
47 lines
2.2 KiB
PHP
<?php
|
|
|
|
Route::group(['middleware' => ['web']], function () {
|
|
Route::prefix('customer')->group(function () {
|
|
|
|
// Login Routes
|
|
Route::get('login', 'Webkul\Customer\Http\Controllers\SessionController@show')->defaults('_config', [
|
|
'view' => 'shop::customers.login.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');
|
|
});
|
|
});
|
|
});
|
|
});
|