-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathroutes.php
96 lines (60 loc) · 3.82 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
<?php
/*Route::get('/', function () {
return view('welcome');
});*/
Route::group(['prefix'=>'admin', 'middleware'=>'auth.checkrole:admin', 'as'=>'admin.'] , function() {
Route::get('categories', ['as'=> 'categories.index', 'uses'=> 'CategoriesController@index']);
Route::get('categories/create', ['as'=> 'categories.create', 'uses'=>'CategoriesController@create']);
Route::get('categories/edit/{id}', ['as'=> 'categories.edit', 'uses'=> 'CategoriesController@edit']);
Route::post('categories/update/{id}', ['as'=> 'categories.update', 'uses'=> 'CategoriesController@update']);
Route::post('categories/store', ['as'=> 'categories.store', 'uses'=>'CategoriesController@store']);
Route::get('clients', ['as'=> 'clients.index', 'uses'=> 'ClientsController@index']);
Route::get('clients/create', ['as'=> 'clients.create', 'uses'=>'ClientsController@create']);
Route::get('clients/edit/{id}', ['as'=> 'clients.edit', 'uses'=> 'ClientsController@edit']);
Route::post('clients/update/{id}', ['as'=> 'clients.update', 'uses'=> 'ClientsController@update']);
Route::post('clients/store', ['as'=> 'clients.store', 'uses'=>'ClientsController@store']);
Route::get('products', ['as'=> 'products.index', 'uses'=> 'ProductsController@index']);
Route::get('products/create', ['as'=> 'products.create', 'uses'=>'ProductsController@create']);
Route::get('products/edit/{id}', ['as'=> 'products.edit', 'uses'=> 'ProductsController@edit']);
Route::post('products/update/{id}', ['as'=> 'products.update', 'uses'=> 'ProductsController@update']);
Route::post('products/store', ['as'=> 'products.store', 'uses'=>'ProductsController@store']);
Route::get('products/destroy/{id}', ['as'=> 'products.destroy', 'uses'=>'ProductsController@destroy']);
Route::get('orders', ['as'=> 'orders.index', 'uses'=> 'OrdersController@index']);
Route::get('orders/{id}', ['as'=> 'orders.edit', 'uses'=> 'OrdersController@edit']);
Route::post('orders/update/{id}', ['as'=> 'orders.update', 'uses'=> 'OrdersController@update']);
Route::get('cupoms', ['as'=> 'cupoms.index', 'uses'=> 'CupomsController@index']);
Route::get('cupoms/create', ['as'=> 'cupoms.create', 'uses'=>'CupomsController@create']);
Route::post('cupoms/store', ['as'=> 'cupoms.store', 'uses'=> 'CupomsController@store']);
});
Route::group(['prefix'=>'customer', 'middleware'=>'auth.checkrole:client' ,'as'=>'customer.'], function() {
Route::get('order', ['as' => 'order.index', 'uses'=>'CheckoutController@index']);
Route::get('order/create', ['as' => 'order.create', 'uses'=>'CheckoutController@create']);
Route::post('order/store', ['as' => 'order.store', 'uses'=>'CheckoutController@store']);
});
Route::group(['middleware' => 'cors'], function(){
Route::post('oauth/access_token', function(){
return Response::json(Authorizer::issueAccessToken());
});
Route::group(['prefix'=>'api', 'middleware'=>'oauth', 'as'=>'api.'], function() {
//Route::get('authenticated',['as'=> 'authenticated','uses' => 'UsersController@authenticated']);
Route::group(['prefix'=>'client', 'middleware' => 'oauth.checkrole:client', 'as'=>'client.'], function(){
Route::resource('order',
'Api\Client\ClientCheckoutController',[
'except' => ['create', 'edit', 'destroy']
]);
//except metodos que não quero q seja criados
Route::get('products', 'Api\Client\ClientProductController@index');
});
Route::group(['prefix'=>'deliveryman', 'middleware' => 'oauth.checkrole:deliveryman', 'as'=>'deliveryman.'],
function() {
Route::resource('order',
'Api\Deliveryman\DeliverymanCheckoutController', [
'except' => ['create', 'edit', 'destroy', 'store']
]);
//except metodos que não quero q seja criados
Route::patch('order/{id}/update-status', [
'as' => 'orders.update_status',
'uses' => 'Api\Deliveryman\DeliverymanCheckoutController@updateStatus']);
});
});
});