artisan route:find
I've come across working on some Laravel-based apps that have probably 100+ routes and it can become a bit annoying to quickly find things you are looking for., (*1)
artisan route:list + grep is fine, mostly, but I ended up making a bash function to do it, as well as trimming extra whitespace from the results. Then I thought "Hey, it would be nice if there was something built in to the framework." Something like artisan route:find, (*2)
So, here it is, a proof-of-concept kind of thing., (*3)
Install and Set-up
composer require sevenshores/artisan-route-find
Register the command by adding it to app/Console/Kernel:, (*4)
protected $commands = [
\SevenShores\RouteFinder\RouteFindCommand::class,
];
Usage
and now you can do something like:, (*5)
php artisan route:find api/files
, (*6)
and to trim extra whitespace from the results:, (*7)
php artisan route:find api/files --trim
, (*8)