public function update(string $action)
    {
        $action = mb_strtolower($action);

        if (! in_array($action, ['enable', 'disable'])) {
            return $this->respondsWithError(trans('globals.action_not_allowed'));
        }

        Auth::user()->$action();

    	return $this->respondsWithSuccess(trans('user.success'));
    }
public function update(string $action)
    {
        $action = mb_strtolower($action);

        if (! in_array($action, ['enable', 'disable'])) {
            return $this->respondsWithError(trans('globals.action_not_allowed'));
        }

        Auth::user()->$action();

    	return $this->respondsWithSuccess(trans('user.success'));
    }
public function update ( string $ action ) { $ action = mb_strtolower ( $ action ) ; if ( ! in_array ( $ action , [ 'enable' , 'disable' ] ) ) { return $ this -> respondsWithError ( trans ( 'globals.action_not_allowed' ) ) ; } Auth :: user ( ) -> $ action ( ) ; return $ this -> respondsWithSuccess ( trans ( 'user.success' ) ) ; }
Update user's profile with a given action.

@param  string $action

@return void
Update user s profile with a given action .