FEATURE #2048: add basics of permissions management

This commit is contained in:
Michal Kváček
2017-08-10 23:18:53 +02:00
parent f702ba3a29
commit cccdbda543
18 changed files with 483 additions and 147 deletions
+10 -48
View File
@@ -10,55 +10,17 @@ Route::pattern('id', '\d+');
Route::pattern('url', '[0-9\-a-z]+');
/*******************************************************************************/
Auth::routes();
$this->get('logout', 'Auth\LoginController@logout')->name('logout');
Route::group(['prefix' => LaravelLocalization::setLocale(), 'middleware' => ['bindings']], function () {
/**
* This route group serves to handle request in admin
*/
Route::group([
'middleware' => ['admin'],
'namespace' => 'Admin',
'prefix' => 'admin'
], function () {
Route::group(['prefix' => LaravelLocalization::setLocale(), 'middleware' => ['bindings', 'web']], function () {
// Homepage
Route::get('/', 'Visitor\Homepage@getIndex')
->name('page.index');
// include all routes in routes/admin subfolder
$files = ['contents', 'fileManager', 'settings', 'templates', 'users', 'widgets'];
foreach ($files as $file) {
require_once __DIR__ . DIRECTORY_SEPARATOR . 'admin' . DIRECTORY_SEPARATOR . $file . '.php';
}
// route for sitemap
Route::get('sitemap.xml', 'Visitor\Sitemap@getMap')
->name('sitemap');
// display dashboard with some usefull information
Route::get('/', 'Dashboard\Dashboard@index')
->name('admin.dashboard');
// list of all actions
Route::get('actions', 'ActionLog\Overview@index')
->name('log.overview');
// search form with results
Route::get('search', 'Search@getSearch')
->name('search');
});
/**************************************************************************************/
/**
* This section must be specified as last one
*/
Route::group(['middleware' => ['web']], function () {
// Homepage
Route::get('/', 'Visitor\Homepage@getIndex')
->name('page.index');
// route for sitemap
Route::get('sitemap.xml', 'Visitor\Sitemap@getMap')
->name('sitemap');
// route for all content pages. This rule must be specified last (because it matches every route)
Route::get('{url}', 'Visitor\ContentPage@getPage')
->name('page.content');
});
// route for all content pages. This rule must be specified last (because it matches every route)
Route::get('{url}', 'Visitor\ContentPage@getPage')
->name('page.content');
});