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.
The package will add a route for each blade.php that it finds in directory you've specified.
Imagine you've configured view discovery this way.
// config/route-discovery
'discover_views_in_directory' => [
'docs' => resource_path('views/docs'),
],
And image that views/docs contains these Blade views...
... then these routes will be registered:
The registered routes will also be named automatically. The route name will be generated by replacing the / with .. So there routes will have these names:
How can I help you explore Laravel packages today?