Route Usage for Laravel is a package by Julien Bourdeau that logs route usage for your Laravel apps. Logging routes with this package is an excellent way of figuring out which routes are not in use:
After a few years, any projects have dead code and unused endpoints. Typically, you removed a link on your frontend, nothing ever links to that old /special-page. You want to remove it, but you’re not sure. Have a look at the route_usage table and figure out when this page was accessed for the last time.
Once you install this package, you can see route usage by visiting
/route-usage in your application. Please note that this page is publicly accessible at the time of writing, and it logs 2xx and 3xx-level responses.
The package also comes with a
usage:route console command which provides the following console output:
Please note that this package is in the early stages of development, and is a perfect time to provide feedback to help shape the first stable release.
You can learn more about this package, get full installation instructions, and view the source code on GitHub at julienbourdeau/route-usage.