Posts Learn Components Snippets Categories Tags Tools About
/

How to Get All of The Available Routes in Laravel

Learn how to get all of the available routes in Laravel

Created on Jul 12, 2021

199 views

Sometimes you might want to get all of the available routes in Laravel to see the bird-eye view of the available routes.

Via Command Line
To do that you can run the route list command in your terminal.
php artisan route:list

Via Route Facade
The other method is to use the "getRoutes()" method of the "Route" facade.
Route::get('/get-all-routes', function () {
    return \Route::getRoutes();
});

If you like our tutorial, do make sure to support us by being our Patreon or buy us some coffee ☕️

)