Merge pull request #4067 from JosephSilber/fluent-routes

[5.4] Use fluent routes
This commit is contained in:
Taylor Otwell 2016-12-07 22:27:46 -06:00 committed by GitHub
commit 61b157f809
1 changed files with 11 additions and 13 deletions

View File

@ -51,10 +51,9 @@ public function map()
*/
protected function mapWebRoutes()
{
Route::group([
'middleware' => 'web',
'namespace' => $this->namespace,
], function ($router) {
Route::middleware('web')
->namespace($this->namespace)
->group(function ($router) {
require base_path('routes/web.php');
});
}
@ -68,11 +67,10 @@ protected function mapWebRoutes()
*/
protected function mapApiRoutes()
{
Route::group([
'middleware' => 'api',
'namespace' => $this->namespace,
'prefix' => 'api',
], function ($router) {
Route::prefix('api')
->middleware('api')
->namespace($this->namespace)
->group(function ($router) {
require base_path('routes/api.php');
});
}