Get Current Route Name using Laravel 9 Example

Jul 15, 2022

.

Admin

Get Current Route Name using Laravel 9 Example

I am going to explain you example of laravel get current route name. I explained simply about laravel 9 get current route. you can see laravel get route name from url. We will use laravel get route name from url. Follow bellow tutorial step of get route name laravel 9.

Let's start following example

Using Request:


$routeName = Request::route()->getName());

print($routeName);

Using Route:

$routeName = Route::getCurrentRoute()->getPath();

print($routeName);

#Laravel 9

#Laravel