2018-07-12 07:12:48 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
Route::group(['middleware' => ['web']], function () {
|
2018-08-10 09:28:35 +00:00
|
|
|
|
2018-07-28 13:03:47 +00:00
|
|
|
Route::get('/', 'Webkul\Shop\Http\Controllers\HomeController@index')->defaults('_config', [
|
2018-08-21 10:58:55 +00:00
|
|
|
'view' => 'shop::home.index'
|
2018-08-23 13:11:56 +00:00
|
|
|
])->name('store.home');
|
2018-08-10 09:28:35 +00:00
|
|
|
|
2018-08-21 10:58:55 +00:00
|
|
|
Route::get('/categories/{slug}', 'Webkul\Shop\Http\Controllers\CategoryController@index')->defaults('_config', [
|
2018-08-17 05:48:21 +00:00
|
|
|
'view' => 'shop::products.index'
|
|
|
|
|
]);
|
2018-08-21 13:14:48 +00:00
|
|
|
|
|
|
|
|
Route::view('/products/{slug}', 'shop::store.product.details.index');
|
|
|
|
|
|
2018-08-22 07:27:41 +00:00
|
|
|
//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', [
|
2018-08-23 13:11:56 +00:00
|
|
|
'redirect' => 'customer.account.index'
|
2018-08-22 07:27:41 +00:00
|
|
|
])->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', [
|
2018-08-23 13:11:56 +00:00
|
|
|
'redirect' => 'customer.account.index',
|
2018-08-22 07:27:41 +00:00
|
|
|
])->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');
|
|
|
|
|
|
2018-08-24 05:18:53 +00:00
|
|
|
Route::view('/cart', 'shop::store.product.cart.cart.index')->name('customer.cart');
|
2018-08-23 13:11:56 +00:00
|
|
|
|
|
|
|
|
Route::view('/product', 'shop::store.product.details.home.index')->name('customer.product');
|
|
|
|
|
|
|
|
|
|
Route::view('/product/review', 'shop::store.product.review.index')->name('customer.product.review');
|
|
|
|
|
|
2018-08-22 07:27:41 +00:00
|
|
|
//customer account
|
|
|
|
|
Route::prefix('account')->group(function () {
|
2018-08-23 13:11:56 +00:00
|
|
|
|
|
|
|
|
Route::get('account/index', 'Webkul\Customer\Http\Controllers\AccountController@index')->defaults('_config', [
|
|
|
|
|
'view' => 'shop::customers.account.index'
|
|
|
|
|
])->name('customer.account.index');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Profile Routes Starts Here */
|
|
|
|
|
Route::get('profile', 'Webkul\Customer\Http\Controllers\CustomerController@index')->defaults('_config', [
|
2018-08-22 07:27:41 +00:00
|
|
|
'view' => 'shop::customers.account.profile.index'
|
2018-08-23 13:11:56 +00:00
|
|
|
])->name('customer.profile.index');
|
2018-08-22 07:27:41 +00:00
|
|
|
|
|
|
|
|
//profile edit
|
2018-08-23 13:11:56 +00:00
|
|
|
Route::get('profile/edit', 'Webkul\Customer\Http\Controllers\CustomerController@editIndex')->defaults('_config', [
|
|
|
|
|
'view' => 'shop::customers.account.profile.edit'
|
|
|
|
|
])->name('customer.profile.edit');
|
|
|
|
|
|
|
|
|
|
Route::post('profile/edit', 'Webkul\Customer\Http\Controllers\CustomerController@edit')->defaults('_config', [
|
2018-08-22 07:27:41 +00:00
|
|
|
'view' => 'shop::customers.account.profile.edit'
|
|
|
|
|
])->name('customer.profile.edit');
|
2018-08-23 13:11:56 +00:00
|
|
|
/* Profile Routes Ends Here */
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Routes for Addresses */
|
|
|
|
|
|
|
|
|
|
Route::get('address/index', 'Webkul\Customer\Http\Controllers\AddressController@index')->defaults('_config', [
|
|
|
|
|
'view' => 'shop::customers.account.address.address'
|
|
|
|
|
])->name('customer.address.index');
|
|
|
|
|
|
|
|
|
|
Route::get('address/create', 'Webkul\Customer\Http\Controllers\AddressController@show')->defaults('_config', [
|
|
|
|
|
'view' => 'shop::customers.account.address.create'
|
|
|
|
|
])->name('customer.address.create');
|
|
|
|
|
|
|
|
|
|
Route::post('address/create', 'Webkul\Customer\Http\Controllers\AddressController@create')->defaults('_config', [
|
2018-08-24 05:18:53 +00:00
|
|
|
'view' => 'shop::customers.account.address.address',
|
|
|
|
|
'redirect' => 'customer.address.index'
|
2018-08-23 13:11:56 +00:00
|
|
|
])->name('customer.address.create');
|
|
|
|
|
|
2018-08-24 05:18:53 +00:00
|
|
|
Route::get('address/edit', 'Webkul\Customer\Http\Controllers\AddressController@showEdit')->defaults('_config', [
|
|
|
|
|
'view' => 'shop::customers.account.address.edit'
|
2018-08-23 13:11:56 +00:00
|
|
|
])->name('customer.address.edit');
|
|
|
|
|
|
|
|
|
|
Route::post('address/edit', 'Webkul\Customer\Http\Controllers\AddressController@edit')->defaults('_config', [
|
|
|
|
|
'view' => 'shop::customers.account.address.address'
|
|
|
|
|
])->name('customer.address.edit');
|
|
|
|
|
|
|
|
|
|
/* Routes for Addresses ends here */
|
|
|
|
|
|
|
|
|
|
/* Wishlist route */
|
|
|
|
|
Route::get('wishlist', 'Webkul\Customer\Http\Controllers\WishlistController@wishlist')->defaults('_config', [
|
|
|
|
|
'view' => 'shop::customers.account.wishlist.wishlist'
|
|
|
|
|
])->name('customer.wishlist.index');
|
|
|
|
|
|
|
|
|
|
/* Orders route */
|
|
|
|
|
Route::get('orders', 'Webkul\Customer\Http\Controllers\OrdersController@orders')->defaults('_config', [
|
|
|
|
|
'view' => 'shop::customers.account.orders.orders'
|
|
|
|
|
])->name('customer.orders.index');
|
|
|
|
|
|
|
|
|
|
/* Reviews route */
|
|
|
|
|
Route::get('reviews', 'Webkul\Customer\Http\Controllers\CustomerController@reviews')->defaults('_config', [
|
|
|
|
|
'view' => 'shop::customers.account.reviews.reviews'
|
|
|
|
|
])->name('customer.reviews.index');
|
|
|
|
|
|
2018-08-22 07:27:41 +00:00
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
//customer routes end here
|
|
|
|
|
|
2018-07-12 07:12:48 +00:00
|
|
|
});
|