public function action($removeHttpMethod = true)
    {
        if ($action = $this->router->currentRouteAction()) {
            $action = last(Str::parseCallback($action, null));

            if ($removeHttpMethod) {
                $action = str_replace(['get', 'post', 'patch', 'put', 'delete'], '', $action);
            }

            return Str::snake($action, '-');
        }

        return null;
    }
public function action($removeHttpMethod = true)
    {
        if ($action = $this->router->currentRouteAction()) {
            $action = last(Str::parseCallback($action, null));

            if ($removeHttpMethod) {
                $action = str_replace(['get', 'post', 'patch', 'put', 'delete'], '', $action);
            }

            return Str::snake($action, '-');
        }

        return null;
    }
public function action ( $ removeHttpMethod = true ) { if ( $ action = $ this -> router -> currentRouteAction ( ) ) { $ action = last ( Str :: parseCallback ( $ action , null ) ) ; if ( $ removeHttpMethod ) { $ action = str_replace ( [ 'get' , 'post' , 'patch' , 'put' , 'delete' ] , '' , $ action ) ; } return Str :: snake ( $ action , '-' ) ; } return null ; }
Get the current controller action name.

@param  bool  $removeHttpMethod
@return string|null
Get the current controller action name .