Skip to content
Advertisement

Laravel 5 how to get route action name?

I’m trying to get the current route action, but I’m not sure how to go about it. In Laravel 4 I was using Route::currentRouteAction() but now it’s a bit different.

I’m trying to do Route::getActionName() in my controller but it keeps giving me method not found.

JavaScript

Advertisement

Answer

In Laravel 5 you should be using Method or Constructor injection. This will do what you want:

JavaScript
User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement