Check if the Route exists in Laravel

I wanted to check if the route I created really exists, cause I couldn’t do the obvious ‘php artisan route:list’ because it threw back some errors, so I searched the internet and found this..

The fastest way to check is with tinker typing on the terminal:

php artisan tinker

then:

Route::has('your_route')

or

route('your_route')

Hope it helps you.

5 thoughts on “Check if the Route exists in Laravel”

Leave a Comment

Your email address will not be published. Required fields are marked *

Tweet
Share
Share
Pin