* * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ $api = app('api.router'); Route::group(['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('user.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->resource('user', 'CamilStaps\BotleaguesApi\Controllers\UserController', ['only' => ['update', 'destroy']]); }); $api->version('v1', ['protected' => true, 'providers' => 'activationcode'], function ($api) { $api->resource('user.password_reminder', 'CamilStaps\BotleaguesApi\Controllers\PasswordReminderController', ['only' => ['destroy']]); }); $api->version('v1', ['protected' => true, 'providers' => 'token'], function ($api) { $api->resource('bot', 'CamilStaps\BotleaguesApi\Controllers\BotController', ['except' => ['index', 'show', 'create','edit']]); $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']]); }); $api->group(['before' => 'current_user'], function() use ($api) { $api->resource('user.token', 'CamilStaps\BotleaguesApi\Controllers\UserTokenController', ['only' => ['index', 'show']]); }); }); });