As our application grows bigger and bigger, the overview in the routes.php file was lost.

The solution we came up with was creating multiple routes files with the part of the website the file was responsible for in the filename.

First of all, I created a directory called Routes and moved the standard routes.php file to there, then I created an extra file, in our case we wanted to split the normal routes from the backoffice routes. So I created the file backoffice.routes.php. Structure by then:


Next, I changed the RouteServiceProvider map method to contain the right calls to both route files;


Last thing to do; fill the backoffice.routes.php with actual routes. I’ll leave that part up to you :)

| Backoffice Routes
| Here is where we register all our backoffice function's.

Route::group(['middleware' => 'adminFunctions'], function () {
    // Well, some routes.

Thats all folks!