|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
/* |
|
4
|
|
|
|-------------------------------------------------------------------------- |
|
5
|
|
|
| Application Routes |
|
6
|
|
|
|-------------------------------------------------------------------------- |
|
7
|
|
|
| |
|
8
|
|
|
| Here is where you can register all of the routes for an application. |
|
9
|
|
|
| It's a breeze. Simply tell Laravel the URIs it should respond to |
|
10
|
|
|
| and give it the controller to call when that URI is requested. |
|
11
|
|
|
| |
|
12
|
|
|
*/ |
|
13
|
|
|
|
|
14
|
|
|
Route::pattern('id', '\d+'); |
|
15
|
|
|
|
|
16
|
|
|
// V1 API |
|
17
|
|
|
Route::group(['prefix' => 'api/v1', 'namespace' => 'Api\V1'], function() |
|
18
|
|
|
{ |
|
19
|
|
|
// users/auth |
|
20
|
|
|
Route::post('user/login', 'UserController@authenticate'); |
|
21
|
|
|
Route::get('user/logout/{api_key}', 'UserController@deauthenticate'); |
|
22
|
|
|
|
|
23
|
|
|
// page |
|
24
|
|
|
Route::get('page/{id}', 'PageController@show'); |
|
25
|
|
|
Route::get('page/{slug}', 'PageController@showBySlug'); |
|
26
|
|
|
Route::post('page', 'PageController@create'); |
|
27
|
|
|
Route::get('page/{id}/detail', 'PageController@showWithDetail'); |
|
28
|
|
|
Route::get('pagedetail/{id}', 'PageDetailController@show'); |
|
29
|
|
|
Route::post('pagedetail', 'PageDetailController@create'); |
|
30
|
|
|
|
|
31
|
|
|
// template |
|
32
|
|
|
Route::get('template/{id}', 'TemplateController@show'); |
|
33
|
|
|
Route::post('template', 'TemplateController@create'); |
|
34
|
|
|
Route::get('template/{id}/detail', 'TemplateController@showWithDetail'); |
|
35
|
|
|
Route::get('templatedetail/{id}', 'TemplateDetailController@show'); |
|
36
|
|
|
Route::post('templatedetail', 'TemplateDetailController@create'); |
|
37
|
|
|
}); |
|
38
|
|
|
|
|
39
|
|
|
Route::any('{any}', function($route) |
|
|
|
|
|
|
40
|
|
|
{ |
|
41
|
|
|
return \App\Http\Controllers\Api\V1\ApiController::respondNotFound('Invalid Route!'); |
|
42
|
|
|
})->where('any', '(.*)'); |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.