How to get current route name in Laravel 5?

By Hardik Savani | April 10, 2016 | | 15840 Viewer | Category : Laravel

Whenever you need to get current route name then you can get using Request or Route facade. I give you two example one for using Route facade and another for Request facade. so you can get route name both way and how you can see both example.

Using Request:

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


Using Route:

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


Please Subscribe Your Email Address, We Will Notify When Add New Post:

We are Recommending you: