Posts Learn Snippets Categories Tags 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

14 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();
});

Created by

PostSrc poster

PostSrc

Full stack developer mainly focusing on the front end side of the web. The main author of PostSrc and loves writing tutorial and guides online.