public static function getRequested($key = 'namespace')
    {
        if (!\Route::current()) {
            return;
        }

        $currentAction = \Route::current()->getAction();

        if (isset($currentAction[$key])) {
            return $currentAction[$key];
        }

        return;
    }
public static function getRequested($key = 'namespace')
    {
        if (!\Route::current()) {
            return;
        }

        $currentAction = \Route::current()->getAction();

        if (isset($currentAction[$key])) {
            return $currentAction[$key];
        }

        return;
    }
public static function getRequested ( $ key = 'namespace' ) { if ( ! \ Route :: current ( ) ) { return ; } $ currentAction = \ Route :: current ( ) -> getAction ( ) ; if ( isset ( $ currentAction [ $ key ] ) ) { return $ currentAction [ $ key ] ; } return ; }
Returns the Requested Route Action as a
string, namespace is returned by default.

@param string $key

@return string|void
Returns the Requested Route Action as a string namespace is returned by default .