How to get Current Route name in Laravel

You may use the current, currentRouteName, and currentRouteAction methods on the Route facade to access information about the route handling the incoming request:

$route = Route::current();

You may use below function to get current route name.

$name = Route::currentRouteName();

If you need action name about which method of Controller is used for current route or in coming request then use below piece of code.

$action = Route::currentRouteAction();


Leave a Reply

Your email address will not be published. Required fields are marked *