Laravels routes files can get pretty busy. Before you know it, you have to search within the routes file to find anything.

We can add extra route loading in the provider: class RouteServiceProvider extends ServiceProvider { public function boot(): void { $this->configureRateLimiting(); $this->routes(function (): void { Route::middleware('api') ->group(base_path('routes/api.php')); Route::middleware('api') ->group(base_path('routes/resource/catalog.php')); Route::middleware('api') ->group(base_path('routes/resource/orders.php')); Route::middleware('api') ->group(base_path('routes/resource/payments.php')); Route::middleware('api') ->group(base_path('routes/resource/deliveries.php')); }); }}

You open the routes file and look at the routes registered to understand the application size and how things are put together.

Looking at the routes file, we can see the groups building up your application, but it isn’t taking over the file - even if you end up with 20-30 groups, it is still pretty readable.
Newsletter

Get the latest Laravel/PHP jobs, events and curated articles straight to your inbox, once a week

Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future. Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future.
Community Partners