spatie/laravel-route-discovery
Automatically discover Laravel routes by scanning controllers and views instead of manually defining them. Configure discovery in your routes files and use PHP attributes to customize names, middleware, and more for each discovered route.
Route::get(), Route::post()) and consolidating route definitions into controllers via PHP attributes. Aligns with modern PHP (8.0+) attribute support.routes/web.php/routes/api.php."This package automates Laravel route registration using PHP attributes, cutting route-definition time by 30–50% for API-heavy apps. By moving routes into controllers (where they logically belong), we reduce technical debt, accelerate feature delivery, and align with modern PHP practices. Low-risk adoption (MIT license, Spatie-backed) with proven scalability in microservices. ROI: Faster dev cycles, fewer bugs from misconfigured routes."
*"Leverage spatie/laravel-route-discovery to:
Route::get() calls with [Route] attributes on controllers/methods.Discover::controllers()->in(app_path('Http/Controllers/API'))).@Route(name: 'api.users.index')).Example Migration Path:
app/Http/Controllers/API).[Route('users', methods: ['GET'])].routes/api.php with Discover::controllers()->in(app_path('Http/Controllers/API')).How can I help you explore Laravel packages today?