-
-
Notifications
You must be signed in to change notification settings - Fork 136
/
web.php
executable file
·112 lines (104 loc) · 5.44 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
<?php
/*
|--------------------------------------------------------------------------
| 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!
|
*/
/* Public Routes */
// home page
Route::get('/', 'Publics\\HomeController@index');
Route::get('{locale}', 'Publics\\HomeController@index')
->where('locale', implode('|', Config::get('app.locales')));
// open product
Route::get('{any}-{id}', 'Publics\\ProductsController@productPreview')->where('id', '[\d+]+')->where('any', '(.*)');
Route::get('{locale}/{any}-{id}', 'Publics\\ProductsController@productPreview')
->where('locale', implode('|', Config::get('app.locales')))->where('id', '[\d+]+')->where('any', '(.*)');
/* Administration Routes */
Route::middleware(['auth'])->group(function () { // check for autherization
Route::get('admin', 'Admin\\DashboardController@index');
Route::get('{locale}/admin', 'Admin\\DashboardController@index')
->where('locale', implode('|', Config::get('app.locales')));
//////////////
Route::get('admin/publish', 'Admin\\PublishController@index')->where('locale', implode('|', Config::get('app.locales')));
Route::get('{locale}/admin/publish', 'Admin\\PublishController@index');
//////////////
Route::get('admin/edit/pruduct/{number}', 'Admin\\PublishController@index')->where('locale', implode('|', Config::get('app.locales')));
Route::get('{locale}/admin/edit/pruduct/{number}', 'Admin\\PublishController@index');
//////////////
Route::post('admin/publish', 'Admin\\PublishController@setProduct')->where('locale', implode('|', Config::get('app.locales')));
Route::post('{locale}/admin/publish', 'Admin\\PublishController@setProduct');
//////////////
Route::post('admin/edit/pruduct/{number}', 'Admin\\PublishController@setProduct')->where('locale', implode('|', Config::get('app.locales')));
Route::post('{locale}/admin/edit/pruduct/{number}', 'Admin\\PublishController@setProduct');
//////////////
Route::get('admin/products', 'Admin\\ProductsController@index')->where('locale', implode('|', Config::get('app.locales')));
Route::get('{locale}/admin/products', 'Admin\\ProductsController@index');
//////////////
Route::get('admin/categories', 'Admin\\ProductsCategoryController@index')->where('locale', implode('|', Config::get('app.locales')));
Route::get('{locale}/admin/categories', 'Admin\\ProductsCategoryController@index');
//////////////
Route::post('admin/categories', 'Admin\\ProductsCategoryController@setCategory')->where('locale', implode('|', Config::get('app.locales')));
Route::post('{locale}/admin/categories', 'Admin\\ProductsCategoryController@setCategory');
//////////////
Route::post('admin/categories/{number}', 'Admin\\ProductsCategoryController@setCategory')->where('locale', implode('|', Config::get('app.locales')));
Route::post('{locale}/admin/categories/{number}', 'Admin\\ProductsCategoryController@setCategory');
//////////////
Route::get('admin/delete/product/{number}', 'Admin\\ProductsController@deleteProduct')->where('locale', implode('|', Config::get('app.locales')));
Route::get('{locale}/admin/delete/product/{number}', 'Admin\\ProductsController@deleteProduct');
//////////////
Route::get('admin/delete/categories', 'Admin\\ProductsCategoryController@deleteCategories')->where('locale', implode('|', Config::get('app.locales')));
Route::get('{locale}/admin/delete/categories', 'Admin\\ProductsCategoryController@deleteCategories');
//////////////
Route::get('admin/users', 'Admin\\UsersController@index')->where('locale', implode('|', Config::get('app.locales')));
Route::get('{locale}/admin/users', 'Admin\\UsersController@index');
//////////////
Route::post('admin/users', 'Admin\\UsersController@setUser')->where('locale', implode('|', Config::get('app.locales')));
Route::post('{locale}/admin/users', 'Admin\\UsersController@setUser');
//////////////
Route::get('admin/delete/user/{userId}', 'Admin\\UsersController@deleteUser')->where('locale', implode('|', Config::get('app.locales')));
Route::get('{locale}/admin/delete/user/{userId}', 'Admin\\UsersController@deleteUser');
//////////////
Route::post('admin/removeGalleryImage', 'Admin\\PublishController@removeGalleryImage');
});
// Authentication Routes...
Route::get('login', [
'as' => 'login',
'uses' => 'Auth\LoginController@showLoginForm'
]);
Route::post('login', [
'as' => '',
'uses' => 'Auth\LoginController@login'
]);
Route::get('logout', 'Admin\\UsersController@logout');
// Password Reset Routes...
Route::post('password/email', [
'as' => 'password.email',
'uses' => 'Auth\ForgotPasswordController@sendResetLinkEmail'
]);
Route::get('password/reset', [
'as' => 'password.request',
'uses' => 'Auth\ForgotPasswordController@showLinkRequestForm'
]);
Route::post('password/reset', [
'as' => '',
'uses' => 'Auth\ResetPasswordController@reset'
]);
Route::get('password/reset/{token}', [
'as' => 'password.reset',
'uses' => 'Auth\ResetPasswordController@showResetForm'
]);
/* Registration Routes. We dont need it
Route::get('register', [
'as' => 'register',
'uses' => 'Auth\RegisterController@showRegistrationForm'
]);
Route::post('register', [
'as' => '',
'uses' => 'Auth\RegisterController@register'
]);
*/