When starting a new Laravel 5 project, all “web” routes reside in the routes/web.php. Adding a bunch of routes, maybe using Route::group for different controllers, quickly adds up and makes it hard to keep things neatly organized. Lucky for us it is very simple to add your own route files!

First create a new route file in routes folder. I’m gonna call mine admin.php and move all my admin area controllers to this file.

Open your app/Providers/RouteServiceProvider.php and find your method map():

public function map()
{
    $this->mapApiRoutes();

    $this->mapWebRoutes();

    // Add your own method here:
    $this->mapAdminRoutes();
}

And for your mapAdminRoutes() method you simply register a new route file. In my case I’m gonna use /admin as a prefix for my admin controllers, and control access through a special middleware:

protected function mapAdminRoutes()
{
    Route::prefix('admin')
        ->middleware(['web', 'authAdmin:admin_access'])
        ->namespace($this->namespace)
        ->group(base_path('routes/admin.php'))
    ;
}

There you go! Now my new route file can be stripped from its Route::group, and routes/web.php is kept to only public controllers.