src/Http/routes.php
<?php
/**
* This file is part of seat-connector and provides user synchronization between both SeAT and third party platform
*
* Copyright (C) 2019, 2020 Loïc Leuilliot <loic.leuilliot@gmail.com>
*
* 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 <http://www.gnu.org/licenses/>.
*/
Route::group([
'namespace' => 'Warlof\Seat\Connector\Http\Controllers',
], function () {
Route::group([
'prefix' => 'seat-connector',
'middleware' => ['web', 'auth', 'locale'],
], function () {
Route::get('/identities')
->name('seat-connector.identities')
->uses('IdentitiesController@index')
->middleware('can:seat-connector.view');
Route::group([
'middleware' => 'can:global.superuser',
], function () {
Route::get('/settings')
->name('seat-connector.settings')
->uses('SettingsController@index');
Route::post('/settings')
->name('seat-connector.settings')
->uses('SettingsController@update');
Route::post('/settings/command')
->name('seat-connector.settings.command')
->uses('SettingsController@dispatch');
});
Route::group([
'middleware' => 'can:seat-connector.security',
], function () {
Route::get('/users')
->name('seat-connector.users')
->uses('UsersController@index');
Route::delete('/users/{id}')
->name('seat-connector.users.destroy')
->uses('UsersController@destroy');
Route::get('/access')
->name('seat-connector.acl')
->uses('AccessController@index');
Route::post('/access')
->name('seat-connector.acl.create')
->uses('AccessController@create');
Route::delete('/access')
->name('seat-connector.acl.remove')
->uses('AccessController@remove');
Route::group([
'prefix' => 'api',
], function () {
Route::get('/roles')
->name('seat-connector.api.roles')
->uses('LookupController@getRoles');
Route::get('/titles')
->name('seat-connector.api.titles')
->uses('LookupController@getTitles');
Route::get('/squads')
->name('seat-connector.api.squads')
->uses('LookupController@getSquads');
Route::get('/sets')
->name('seat-connector.api.sets')
->uses('LookupController@getSets');
});
});
Route::group([
'middleware' => 'can:seat-connector.logs_review',
], function () {
Route::get('/logs')
->name('seat-connector.logs')
->uses('LogsController@index');
});
});
Route::group([
'namespace' => 'Api',
'middleware' => ['api.request', 'api.auth'],
'prefix' => 'api',
], function () {
Route::group([
'namespace' => 'V2',
'prefix' => 'v2',
], function () {
Route::group([
'prefix' => 'seat-connector',
], function () {
Route::get('/users', 'UserController@index');
});
});
});
});