Reputation: 83
I don't have any idea how to just get action name in Laravel 5.1?? It's giving complete route instead of just action name.
public function saveuserstat(Route $route)
{
echo $route->getActionName();
}
Upvotes: 3
Views: 2890
Reputation: 54419
As getActionName()
returns complete route with controller name and action name, you should do this trick to get action name only:
list(, $action) = explode('@', Route::getCurrentRoute()->getActionName());
Upvotes: 1