Reputation: 415
I'm relatively new to laravel, but was wondering if there is a way using artisan to have it return the route that would be run if supplied a given request URI.
I know I can get a list or routes using:
php artisan route:list
And I can filter routes with --name, --method, --path, etc., but I'm looking for a method to supply a URI path, and have artisan return the route that would match...
Something like
php artisan route:list --requestURI=blog/this-is-my-slug/
with the desired result showing the route URI that laravel would have been directed it to... such as blog/{slug}
Is there anyway to get the route from a request URI using artisan?
Upvotes: 0
Views: 555
Reputation: 875
Currently there is no predefined command exists for this. But you can do it by creating your own artisan commands. Check official Laravel documentation for custom commands in here.
Upvotes: 1