You can install the package via composer:
composer require spatie/laravel-route-discovery
##Publishing the config file
Optionally, you can publish the route-discovery
config file with this command.
php artisan vendor:publish --tag="route-discovery-config"
This is the content of the published config file:
return [
'discover_controllers_in_directory' => [
],
'discover_views_in_directory' => [
],
'pending_route_transformers' => [
...Spatie\RouteDiscovery\Config::defaultRouteTransformers(),
],
];
##A word on performance
Discovering routes during each application request may have a small impact on performance. For increased performance, we highly recommend caching your routes as part of your deployment process.