## 前台路由
routes/web.php
```php
/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| 前台相关路由
|
*/
Route::group([ 'middleware' => ['laracms.frontend'], ], function () {
# 前台所有URL必须加入 navigation 参数,否则面包屑无法正常使用
# 前端示例路由
Route::get('example', 'ExampleController@index')->name('example');
# 前台需要用户认证路由
Route::group(['middleware' => ['auth']], function(){
// 在这里注入路由
});
});
```
## 后台路由
routes/administrator.php
```php
/*
* -------------------------------------------------------------------------
* 后台不需要需要认证相关路由
* -------------------------------------------------------------------------
*/
Route::group(['domain' => config('administrator.domain'), 'prefix' => config('administrator.uri'), 'namespace' => 'Administrator', 'middleware' => [], ], function () {
// 这里注册路由
});
/*
* -------------------------------------------------------------------------
* 后台需要认证相关路由
* -------------------------------------------------------------------------
*/
Route::group(['domain' => config('administrator.domain'), 'prefix' => config('administrator.uri'), 'namespace' => 'Administrator', 'middleware' => ['laracms.auth'], ], function () {
# 后端示例路由
Route::get('example', 'ExampleController@index')->name('administrator.example');
});
```
具体路由使用方法请移步:[https://laravel-china.org/docs/laravel/5.7/routing/2253](https://laravel-china.org/docs/laravel/5.7/routing/2253)