Support the ongoing development of →
posted 8 years ago
Last updated 10 months ago.

The routes.php file should always be there.
In order to add new route files you could do the following:

  1. edit the file app/start/global.php
  2. add new route files:
  • require app_path().'/routes/users.php';
  • require app_path().'/routes/users.php';
Last updated 10 months ago.

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

  • app/Http/Routes/admin.php

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');
Last updated 7 years ago.

Here I have build a package to manage laravel routes. You may check this


With Laravel 5.2, you can do it with this way:

  1. Create your router file in "app/Http" directory
    ex: "app/Http/my_route.php"
  2. Open file "app/Providers/RouteServiceProvider.php"
  • Looking for method "mapWebRoutes(Router $router)" at the end of this class
  • Add a statement like this: " require app_path('Http/my_route.php'); "
    Now you can enjoy your new router file. Have fun!
Last updated 6 years ago.

I wonder how you can do this Laravel 5.3?


Sign in to participate in this thread!


Your banner here too?

Donny5300 donny5300 Joined 3 May 2014


We'd like to thank these amazing companies for supporting us

Your logo here?

The Laravel portal for problem solving, knowledge sharing and community building.

© 2023 - All rights reserved.