-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathweb.php
54 lines (40 loc) · 1.75 KB
/
web.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<?php
use Illuminate\Support\Facades\Route;
/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/
Route::get('/', 'ProductController@home')->name('index');
Route::group([
"prefix" => "products"
], function () {
Route::get('/{category?}', 'ProductController@index')->name('products');
Route::get('/{category?}/{id?}', 'ProductController@show')->name('product');
});
Route::get('/cart', function () {
return view('cart');
})->name('cart');
Route::get('/checkout', function () {
return view('checkout');
})->name('checkout')->middleware('auth');
Route::post('/checkout', "PurchaseController@store")->name('checkout')->middleware('auth');
Route::group([
"prefix" => "user"
], function () {
Route::get('/profile', function () {
return view('profile');
})->name('user-profile')->middleware('auth');
Route::get('/purchases', 'PurchaseController@index')->name('user-purchases')->middleware('auth');
Route::get('/purchases/{id?}', 'PurchaseController@show')->name('user-purchase')->middleware('auth');
Route::post('/change-password', "ProfileController@change_password")->name('change_password')->middleware('auth');
Route::post('/change-profile', "ProfileController@change_profile")->name('change_profile')->middleware('auth');
Route::get('/logout', "ProfileController@logout")->name('exit')->middleware('auth');
});
Auth::routes();
Route::get('/home', 'HomeController@index')->name('home');