aboutsummaryrefslogtreecommitdiff
path: root/src/routes.php
diff options
context:
space:
mode:
authorCamil Staps2015-06-28 00:16:54 +0200
committerCamil Staps2015-06-28 00:16:54 +0200
commit1a3c6167f6a68964a0bd94c064a88794c952efb6 (patch)
tree984508e789b96e2f8906c00a9def229435b45403 /src/routes.php
parentExpose Location header; redirect after storing User (diff)
Lumen
Diffstat (limited to 'src/routes.php')
-rw-r--r--src/routes.php15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/routes.php b/src/routes.php
index 82095f8..89091fe 100644
--- a/src/routes.php
+++ b/src/routes.php
@@ -18,9 +18,11 @@
*
*/
+global $app;
+
$api = app('api.router');
-Route::group(['https'], function() use ($api) {
+$app->group(['https'], function() use ($api) {
$api->version('v1', ['protected' => false], function ($api) {
@@ -40,7 +42,12 @@ Route::group(['https'], function() use ($api) {
['only' => ['index','show']]);
$api->resource('user', 'CamilStaps\BotleaguesApi\Controllers\UserController',
- ['only' => ['index','show','store']]);
+ ['only' => ['index','show','store'],
+ 'names' => [
+ 'index' => 'user.index',
+ 'show' => 'user.show',
+ 'store' => 'user.store'
+ ]]);
$api->resource('user.password_reminder', 'CamilStaps\BotleaguesApi\Controllers\PasswordReminderController',
['only' => ['store']]);
@@ -65,7 +72,7 @@ Route::group(['https'], function() use ($api) {
$api->resource('bot', 'CamilStaps\BotleaguesApi\Controllers\BotController',
['except' => ['index', 'show', 'create','edit']]);
- $api->group(array('before' => 'administrator'), function() use ($api) {
+ $api->group(['middleware' => 'administrator'], function() use ($api) {
$api->resource('competition', 'CamilStaps\BotleaguesApi\Controllers\CompetitionController',
['except' => ['index', 'show', 'create', 'edit']]);
@@ -78,7 +85,7 @@ Route::group(['https'], function() use ($api) {
});
- $api->group(['before' => 'current_user'], function() use ($api) {
+ $api->group(['middleware' => 'current_user'], function() use ($api) {
$api->resource('user.token', 'CamilStaps\BotleaguesApi\Controllers\UserTokenController',
['only' => ['index', 'show']]);