-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathroutes.php
151 lines (129 loc) · 3.7 KB
/
routes.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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
<?php
/*
App::error(function(Symfony\Component\HttpKernel\Exception\ModelNotFoundException $e) {
// return Response::make('Not Found', 404);
//dd(Route::currentRouteName());
return Redirect::route('/')->withInput()->with('error', $error);
});
*/
//dd(Route::currentRouteName());
//Route::when('*', 'csrf', array('delete', 'patch', 'post', 'put'));
/*
Route::get('/', function()
{
new helpers\forms\form\Login;
)};
*/
//Route::get('/', 'Vedette\controllers\AdminController@index');
/*
Route::get('/', array(
'as' => 'home',
'uses' => 'Vedette\controllers\IndexController@index'
));
*/
Route::group(array('before' => 'auth'), function()
{
Route::get('/', array(
'as' => 'home',
'uses' => 'Vedette\controllers\IndexController@index'
));
});
Route::resource('vedette.admin', 'Vedette\controllers\AdminController', array('only' => array('index')));
Route::get(Config::get('vedette.vedette_routes.user_home'), array(
'as' => 'vedette.user',
'uses' => 'Vedette\controllers\IndexController@index')
);
Route::get(Config::get('vedette.vedette_routes.admin_home'), array(
'as' => 'vedette.admin',
'uses' => 'Vedette\controllers\AdminController@index')
);
Route::get('/404', array(
'as' => 'notfound',
'uses' => 'Vedette\controllers\AdminController@notfound'
));
Route::group(array('before' => 'guest'), function()
{
Route::get('login', array(
'as' =>'login',
'uses' => 'Vedette\controllers\SessionsController@create'
));
Route::get('register', array(
'as' =>'register',
'uses' => 'Vedette\controllers\AuthController@create'
));
Route::resource('auth', 'Vedette\controllers\AuthController',
array('only' => array('create', 'store')
));
Route::get('password/forgot', array(
'as' => 'forgot',
'uses' => 'Vedette\controllers\PasswordController@forgot'
));
Route::post('password/reset', array(
'before' => 'csrf',
'as' => 'password.request',
'uses' => 'Vedette\controllers\PasswordController@request'
));
Route::get('password/reset/{token}', array(
'as' => 'password.reset',
'uses' => 'Vedette\controllers\PasswordController@reset'
));
Route::post('password/reset/{token}', array(
'before' => 'csrf',
'as' => 'password.update',
'uses' => 'Vedette\controllers\PasswordController@update'
));
});
/*
Route::group(array('before' => 'auth'), function()
{
Route::resource('auth', 'Vedette\controllers\AuthController', array(
'except' => array('index', 'create', 'store')
));
});
*/
Route::get('login', array(
'as' =>'login',
'uses' => 'Vedette\controllers\SessionsController@create'
));
//Route::get('o-auth/login', 'Vedette\controllers\SessionsController@handleLoginPage');
Route::get('o-auth/login', array(
'as' =>'o-auth/login',
'uses' => 'Vedette\controllers\SessionsController@handleLoginPage'
));
Route::get('logout', array(
'as' =>'logout',
'uses' => 'Vedette\controllers\SessionsController@destroy'
));
Route::resource('sessions', 'Vedette\controllers\SessionsController', array(
'before' => 'csrf',
'only' => array('create', 'store', 'destroy')
));
Route::group(
array(
// 'prefix' => 'admin',
'before' => 'auth.admin'
),
function()
{
Route::get('admin', array(
'as' => 'admin.index',
'uses' => 'Vedette\controllers\AdminController@index'
));
Route::resource('roles', 'Vedette\controllers\RolesController',
array('except' => array('show')
));
Route::resource('users', 'Vedette\controllers\UsersController',
array(
'before' => 'csrf'
// 'except' => array('show')
));
/*
|--------------------------------------------------------------------------
| Chumper Datatables API
|--------------------------------------------------------------------------
*/
Route::get('api/users', array(
'as'=>'api.users',
'uses'=>'Vedette\controllers\UsersController@getDatatable'
));
});