FEATURE #2047: use laravel's authorization
This commit is contained in:
@@ -0,0 +1,64 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This routing groups is used for routing along public part of website
|
||||
*/
|
||||
|
||||
use Mcamara\LaravelLocalization\Facades\LaravelLocalization;
|
||||
|
||||
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 () {
|
||||
|
||||
// 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';
|
||||
}
|
||||
|
||||
// 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');
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user