Controllers and Routes

When should I use src/Routes?

Open 1 replies Updated 2026-07-10 10:24

Original post

For a small project, keeping routes in `public/routes.php` is fine. For a forum, admin area, billing area, or any feature with grouped middleware, I would move those URLs into an app-owned route file under `src/Routes`.

Replies

Visible

Route groups are useful for admin sections because middleware can be attached once. That also makes the route file easier to scan.