The routes.php file should always be there.
In order to add new route files you could do the following:
You can do this by including your route file in app/Providers/RouteServiceProvider.php
. Assuming your all routes file in app\Http\Routes
directory. put your admin.php
file in
Now resister this route file in map
method of RouteServiceProvider.php
.
public function map(Router $router)
{
// Authentication
$router->group(['namespace' => $this->namespace], function($router)
{
require app_path('Http/routes.php');
//custom route file here
require app_path('Http/Routes/admin.php');
});
}
Here I have build a package to manage laravel routes. You may check this https://packagist.org/packages/thedevsaddam/multiple_route
With Laravel 5.2, you can do it with this way:
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community