You can retrieve the current action name with Route::currentRouteAction(). Unfortunately, this method will return a fully namespaced class name. So you will get something like:
App\Http\Controllers\FooBarController@method
Then just separate method name and controller name:
$currentAction = \Route::currentRouteAction();
list($controller, $method) = explode('@', $currentAction);
// $controller now is "App\Http\Controllers\FooBarController"
$controller = preg_replace('/.*\\\/', '', $controller);
// $controller now is "FooBarController"
Laravel 5.6:
Laravel 5.5 and lower:
You can retrieve the current action name with
Route::currentRouteAction()
. Unfortunately, this method will return a fully namespaced class name. So you will get something like:Then just separate method name and controller name: