/** * Define the routes for the application. * * @param \Illuminate\Routing\Router $router */ public function map(Router $router) { $router->middleware('dashboard', AccessMiddleware::class); $router->group(['middleware' => ['web', 'dashboard'], 'prefix' => 'dashboard', 'namespace' => $this->namespace], function ($router) { require __DIR__ . '/../Http/routes.php'; }); $router->group(['middleware' => ['web'], 'prefix' => 'dashboard', 'namespace' => $this->namespace], function ($router) { $router->auth(); }); }
/** * Define the routes for the application. * * @param \Illuminate\Routing\Router $router * @return void */ public function map(Router $router) { $AuthRouterAttributes = ['namespace' => $this->namespace, 'middleware' => 'web']; $router->group($AuthRouterAttributes, function (Router $router) { $router->auth(); }); // Include routes outside namespaced-group to allow usage of ::class // Revert to default laravel<=5.1 behaviour $router->group(['middleware' => ['web', 'auth']], function (Router $router) { require app_path('Http/routes.php'); }); }
/** * Register the typical authentication routes for an application. * * @return void * @static */ public static function auth() { \Illuminate\Routing\Router::auth(); }