Thursday, October 2, 2025
HomeLanguagesGet Current Route Name in Laravel 10|9|8

Get Current Route Name in Laravel 10|9|8

To get current route name, Path in laravel; Through this tutorial, we will learn how to get current route name, path on blade view and controller file in laravel 10|9|8 apps.

How to Get Current Route Name, Path in Laravel 10|9|8

Here is two way to get current route name, path on blade view and controller file in laravel 10|9|8 apps; is as follows:

  • To Get Current Route Name On Controller
  • To Get Current Route Name On Blade View

To Get Current Route Name On Controller

If we want to get the route name, route path on controller file in laravel apps; So, we can use the following method to get route name and route path on controller file; as follows:

First, include the Route facade to your controller:

use Illuminate\Support\Facades\Route;

then use the following code into controller file:

    public function yourMethodHere(){
        $routeName = Route::currentRouteName();
	dd($routeName);
    }

To Get Current Route Name On Blade View

If we want to get the route name, route path on blade view file in laravel apps; So, we can use the following method to get route name and route path on blade view file; as follows:

use the Route facade directly in your Blade view:

{{ Route::currentRouteName() }}

Recommended Laravel Tutorials

Recommended:-Laravel Try Catch

RELATED ARTICLES

Most Popular

Dominic
32331 POSTS0 COMMENTS
Milvus
85 POSTS0 COMMENTS
Nango Kala
6703 POSTS0 COMMENTS
Nicole Veronica
11867 POSTS0 COMMENTS
Nokonwaba Nkukhwana
11926 POSTS0 COMMENTS
Shaida Kate Naidoo
6817 POSTS0 COMMENTS
Ted Musemwa
7078 POSTS0 COMMENTS
Thapelo Manthata
6775 POSTS0 COMMENTS
Umr Jansen
6776 POSTS0 COMMENTS