Illuminate\Routing\Redirector::intended PHP Method

intended() public method

Create a new redirect response to the previously intended location.
public intended ( string $default = '/', integer $status = 302, array $headers = [], boolean $secure = null ) : Illuminate\Http\RedirectResponse
$default string
$status integer
$headers array
$secure boolean
return Illuminate\Http\RedirectResponse
    public function intended($default = '/', $status = 302, $headers = [], $secure = null)
    {
        $path = $this->session->pull('url.intended', $default);
        return $this->to($path, $status, $headers, $secure);
    }

Usage Example

 /**
  * Handle the form.
  *
  * @param LoginFormBuilder  $builder
  * @param UserAuthenticator $authenticator
  * @param Redirector        $redirect
  */
 public function handle(LoginFormBuilder $builder, UserAuthenticator $authenticator, Redirector $redirect)
 {
     if (!($user = $builder->getUser())) {
         return;
     }
     $authenticator->login($user, $builder->getFormValue('remember_me'));
     $builder->setFormResponse($redirect->intended($builder->getFormOption('redirect', '/')));
 }
All Usage Examples Of Illuminate\Routing\Redirector::intended