Laravel Route Registrars is an amazing package that introduces a clean object-based way to define your routes in a Laravel application. If you're installing this package on a fresh laravel installation, you'll want to run the following command before you do anything with your routes. This will overwrite the app/Providers/RouteServiceProvider.php file with one compatible with the route registrars, and create default route registrars to replace both routes/web.php and routes/api.php.

Create the route registrar in app/Http/Routes/Web, an option left in for those of you that are splitting the Web and API routes.

Call the following method with an instance of the laravel router, and the fully qualified class name of the registrars.
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