original_string: 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'));
      }
code: 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'));
      }
code_tokens: 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' ) ) ; }
docstring: Update user's profile with a given action.
  
  @param  string $action
  
  @return void
docstring_tokens: Update user s profile with a given action .