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.