Laravel 9 Get Current Route Name Example

Hello dev, Today we are going to learn Laravel Get Current Route Name Example. In this tutorial we get current route name with examples in laravel 9 application.

This article will provide some of the most important example laravel get route name. I explained simply about laravel get current route. if you want to see an examples of laravel get the route name from the URL then you are in the right place. it’s a simple example of laravel get a route name from URL.

Also Read: Laravel 9 Vue Js Roles and Permissions + Vite Js

Let’s start following example.

Example Laravel 9 Get Current Route Name Example:

Using Request:

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

Also Read: Laravel 9 Send Web Push Notification with Firebase Example

Using Route:

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

Conclusion:

Today, We had learn Laravel 9 Get Current Route Name Example. Hope this tutorial helped you with learning Laravel 9. If you have any question you can ask us at comment section below. If you like the tutorial please subscribe our YouTube Channel and follow us on social network Facebook and Instagram.

Also Read: How to Use Inner Join In Laravel 9?

1 Comment

Leave a Reply