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);
- How to Notifications With database Driver in Laravel 11?
- How to Send Email Via Notification in Laravel 11?
- How to Install and Configure Laravel 11 Debugbar?
- How to Like Dislike System in Laravel 11?
- How to Paginate a Model with Relationship in Laravel 11?
- Laravel 11 Upload Files to Amazon S3 Example
- Laravel 11 Send WhatsApp Messages Example
- Laravel 11 Rest API Authentication Using JWT Tutorial