get controller and action name in Laravel 4-Collection of common programming errors
I’m trying to access the name of the current controller and the current method to pass it to my view as a variable. I’ve tried several ways from pointers I found online but they don’t work so I assume they were for Laravel 3.
Here is what I’ve tried
Request::$route->controller
gives
Access to undeclared static property: Illuminate\Support\Facades\Request::$route
and
Request::route()->controller
gives
Call to undefined method Illuminate\Http\Request::route()