Commit 61b157f8 authored by Taylor Otwell's avatar Taylor Otwell Committed by GitHub

Merge pull request #4067 from JosephSilber/fluent-routes

[5.4] Use fluent routes
parents 99bb0750 ef1ef753
......@@ -51,12 +51,11 @@ class RouteServiceProvider extends ServiceProvider
*/
protected function mapWebRoutes()
{
Route::group([
'middleware' => 'web',
'namespace' => $this->namespace,
], function ($router) {
require base_path('routes/web.php');
});
Route::middleware('web')
->namespace($this->namespace)
->group(function ($router) {
require base_path('routes/web.php');
});
}
/**
......@@ -68,12 +67,11 @@ class RouteServiceProvider extends ServiceProvider
*/
protected function mapApiRoutes()
{
Route::group([
'middleware' => 'api',
'namespace' => $this->namespace,
'prefix' => 'api',
], function ($router) {
require base_path('routes/api.php');
});
Route::prefix('api')
->middleware('api')
->namespace($this->namespace)
->group(function ($router) {
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