Home / Snippets / How to Get All of The Available Routes in Laravel
How to Get All of The Available Routes in Laravel cover

How to Get All of The Available Routes in Laravel

230

3 years ago

0 comments

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

Alaz

Week-end developer currently experimenting with web, mobile, and all things programming.

Topics:

Frontend

Resource

Average

Average

Support Us

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

Welcome to PostSrc V3

PostSrc Dark Logo

You have to login to favorite this