diff options
Diffstat (limited to 'src/routes.php')
-rw-r--r-- | src/routes.php | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/src/routes.php b/src/routes.php new file mode 100644 index 0000000..def14d1 --- /dev/null +++ b/src/routes.php @@ -0,0 +1,60 @@ +<?php +Route::group(array('https'), function() use ($api) { + + $api->version('v1', ['protected' => false], function ($api) { + + $api->resource('bot', 'CamilStaps\BotleaguesApi\Controllers\BotController', + ['only' => ['index','show']]); + + $api->resource('competition', 'CamilStaps\BotleaguesApi\Controllers\CompetitionController', + ['only' => ['index','show']]); + + $api->resource('competition_type', 'CamilStaps\BotleaguesApi\Controllers\CompetitionTypeController', + ['only' => ['index','show']]); + + $api->resource('game', 'CamilStaps\BotleaguesApi\Controllers\GameController', + ['only' => ['index','show']]); + + $api->resource('participant', 'CamilStaps\BotleaguesApi\Controllers\ParticipantController', + ['only' => ['index','show']]); + + $api->resource('user', 'CamilStaps\BotleaguesApi\Controllers\UserController', + ['only' => ['index','show','store']]); + + $api->resource('password_reminder', 'CamilStaps\BotleaguesApi\Controllers\PasswordReminderController', + ['only' => ['store']]); + + }); + + $api->version('v1', ['protected' => true, 'providers' => 'basic'], function ($api) { + $api->resource('user_token', 'CamilStaps\BotleaguesApi\Controllers\UserTokenController', + ['only' => ['store']]); + }); + + $api->version('v1', ['protected' => true, 'providers' => 'token'], function ($api) { + + $api->resource('bot', 'CamilStaps\BotleaguesApi\Controllers\BotController', + ['except' => ['index', 'show', 'create','edit']]); + + $api->resource('user', 'CamilStaps\BotleaguesApi\Controllers\UserController', + ['except' => ['index', 'show', 'create','edit','store']]); + + $api->resource('user_token', 'CamilStaps\BotleaguesApi\Controllers\UserTokenController', + ['only' => ['index', 'show']]); + + $api->group(array('before' => 'administrator'), function() use ($api) { + + $api->resource('competition', 'CamilStaps\BotleaguesApi\Controllers\CompetitionController', + ['except' => ['index', 'show', 'create', 'edit']]); + + $api->resource('competition_type', 'CamilStaps\BotleaguesApi\Controllers\CompetitionTypeController', + ['except' => ['index', 'show', 'create', 'edit']]); + + $api->resource('game', 'CamilStaps\BotleaguesApi\Controllers\GameController', + ['except' => ['index', 'show', 'create','edit']]); + + }); + + }); + +});
\ No newline at end of file |