Posts Learn Components new Snippets new Categories Tags About Device Beast sponsor
/

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

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

Snippets 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.

new

PostSrc Code Components

Collection of Tailwind CSS components for everyone to use. Browse all of the components that are right for your project.

View Components

Other Code Snippets

More