Commit ef1ef753 authored by Joseph Silber's avatar Joseph Silber

Use fluent routes

parent 99bb0750
...@@ -51,12 +51,11 @@ class RouteServiceProvider extends ServiceProvider ...@@ -51,12 +51,11 @@ class RouteServiceProvider extends ServiceProvider
*/ */
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,12 +67,11 @@ class RouteServiceProvider extends ServiceProvider ...@@ -68,12 +67,11 @@ class RouteServiceProvider extends ServiceProvider
*/ */
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'); });
});
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment