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