just use web group by default

This commit is contained in:
Taylor Otwell 2016-03-23 17:04:42 -05:00
parent 1d5e88d0fb
commit 5c30c98db9
2 changed files with 19 additions and 8 deletions

View File

@ -11,10 +11,6 @@
| |
*/ */
Route::group(['middleware' => ['web']], function () { Route::get('/', function () {
return view('welcome');
Route::get('/', function () {
return view('welcome');
});
}); });

View File

@ -8,7 +8,7 @@
class RouteServiceProvider extends ServiceProvider class RouteServiceProvider extends ServiceProvider
{ {
/** /**
* This namespace is applied to the controller routes in your routes file. * This namespace is applied to your controller routes.
* *
* In addition, it is set as the URL generator's root namespace. * In addition, it is set as the URL generator's root namespace.
* *
@ -37,7 +37,22 @@ public function boot(Router $router)
*/ */
public function map(Router $router) public function map(Router $router)
{ {
$router->group(['namespace' => $this->namespace], function ($router) { $this->mapWebRoutes($router);
//
}
/**
* Define the "web" routes for the application.
*
* @param \Illuminate\Routing\Router $router
* @return void
*/
protected function mapWebRoutes(Router $router)
{
$router->group([
'namespace' => $this->namespace, 'middleware' => 'web'
], function ($router) {
require app_path('Http/routes.php'); require app_path('Http/routes.php');
}); });
} }