original_string: protected function redirectAfterSaving($resourcesPath, $key)
      {
          if (request('after-save') == 1) {
              // continue editing
              $url = rtrim($resourcesPath, '/')."/{$key}/edit";
          } elseif (request('after-save') == 2) {
              // continue creating
              $url = rtrim($resourcesPath, '/').'/create';
          } elseif (request('after-save') == 3) {
              // view resource
              $url = rtrim($resourcesPath, '/')."/{$key}";
          } else {
              $url = request(Builder::PREVIOUS_URL_KEY) ?: $resourcesPath;
          }
  
          admin_toastr(trans('admin.save_succeeded'));
  
          return redirect($url);
      }
code: protected function redirectAfterSaving($resourcesPath, $key)
      {
          if (request('after-save') == 1) {
              // continue editing
              $url = rtrim($resourcesPath, '/')."/{$key}/edit";
          } elseif (request('after-save') == 2) {
              // continue creating
              $url = rtrim($resourcesPath, '/').'/create';
          } elseif (request('after-save') == 3) {
              // view resource
              $url = rtrim($resourcesPath, '/')."/{$key}";
          } else {
              $url = request(Builder::PREVIOUS_URL_KEY) ?: $resourcesPath;
          }
  
          admin_toastr(trans('admin.save_succeeded'));
  
          return redirect($url);
      }
code_tokens: protected function redirectAfterSaving ( $ resourcesPath , $ key ) { if ( request ( 'after-save' ) == 1 ) { // continue editing $ url = rtrim ( $ resourcesPath , '/' ) . "/{$key}/edit" ; } elseif ( request ( 'after-save' ) == 2 ) { // continue creating $ url = rtrim ( $ resourcesPath , '/' ) . '/create' ; } elseif ( request ( 'after-save' ) == 3 ) { // view resource $ url = rtrim ( $ resourcesPath , '/' ) . "/{$key}" ; } else { $ url = request ( Builder :: PREVIOUS_URL_KEY ) ? : $ resourcesPath ; } admin_toastr ( trans ( 'admin.save_succeeded' ) ) ; return redirect ( $ url ) ; }
docstring: Get RedirectResponse after data saving.
  
  @param string $resourcesPath
  @param string $key
  
  @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
docstring_tokens: Get RedirectResponse after data saving .