How to Get All Routes in Laravel?

Hello Friends,

This tutorial shows you how to get all routes in laravel. In this article, we will implement a how to list routes in laravel. We will look at an example of laravel get all routes list. I explained simply step by step laravel routes list.

You can use this example with laravel 6, laravel 7, laravel 8 and laravel 9 versions.

I will give you a simple example of how to get an all routes list in laravel application. we will use getRoutes() function of Route facade to get list of all routes in laravel.

So, without further ado please check the below steps:

Step 1: Create Route

In this step, we will add one get-all-routes route to display all routes in laravel. So, let’s add a new route to that file.



use IlluminateSupportFacadesRoute;

use AppHttpControllersDemoController;



| Web Routes



| Here is where you can register web routes for your application. These

| routes are loaded by the RouteServiceProvider within a group which

| contains the "web" middleware group. Now create something great!



Route::get('get-all-routes', [DemoController::class, 'index']);

Step 2: Create Controller

in the next step, now we have created a new controller as DemoController and write index method on it like as below, So let’s create a controller:



namespace AppHttpControllers;

use IlluminateHttpRequest;

use IlluminateSupportFacadesRoute;

class DemoController extends Controller



* Write code on Method


* @return response()


public function index(Request $request)


$routes = Route::getRoutes();

return view('routesList', compact('routes'));



Step 3: Create Blade File

In this step, we need to create one blade file with routesList.blade.php to display all routes, so let’s update following code on it:


<!DOCTYPE html>



<title>How to Get All Routes in Laravel? -</title>

<link href="" rel="stylesheet">



<div class="container">

<h1>How to Get All Routes in Laravel? -</h1>

<table class="table table-bordered data-table">










@foreach($routes as $route)


<td>{{ $route->methods()[0] }}</td>

<td>{{ $route->uri() }}</td>

<td>{{ $route->getName() }}</td>

<td>{{ $route->getActionName() }}</td>








Run Laravel App:

All the required steps have been done, now you have to type the given below command and hit enter to run the Laravel app:

php artisan serve

Now, Go to your web browser, type the given URL and view the app output:



How to Get All Routes in Laravel?

I hope it can help you…

1 thought on “How to Get All Routes in Laravel?”

Leave a Comment