本文整理匯總了PHP中Illuminate\Routing\Redirector::intended方法的典型用法代碼示例。如果您正苦於以下問題:PHP Redirector::intended方法的具體用法?PHP Redirector::intended怎麽用?PHP Redirector::intended使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Illuminate\Routing\Redirector
的用法示例。
在下文中一共展示了Redirector::intended方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: handle
/**
* 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', '/')));
}
示例2: handle
/**
* Handle the form.
*
* @param LoginFormBuilder $builder
* @param UserAuthenticator $authenticator
* @param UserSecurity $security
* @param Redirector $redirect
*/
public function handle(LoginFormBuilder $builder, UserAuthenticator $authenticator, UserSecurity $security, Redirector $redirect)
{
if (!($user = $builder->getUser())) {
return;
}
$response = $security->check($user);
if ($response instanceof Response) {
$authenticator->logout($user);
$builder->setFormResponse($response);
return;
}
$authenticator->login($user, $builder->getFormValue('remember_me'));
$builder->setFormResponse($redirect->intended($builder->getFormOption('redirect', '/')));
}
示例3: postIndex
/**
* Show the login form
*
* @return mixed
*/
public function postIndex()
{
// Pick up the honeypot field to stop bots, return to the login screen, no message
if ($this->request->get('potter')) {
return $this->redirect->to('auth/login')->withInput();
}
if (!$this->validator->with($this->request->all())->passes()) {
return $this->redirect->to('auth/login')->withErrors($this->validator->errors());
}
if ($this->auth->attempt(['username' => $this->request->get('username'), 'password' => $this->request->get('password')])) {
return $this->redirect->intended('/');
}
$this->session->flash('failed', trans('auth.incorrect_username_or_password'));
return $this->redirect->to('auth/login')->withInput();
}
示例4: intended
/**
* Create a new redirect response to the previously intended location.
*
* @param string $default
* @param int $status
* @param array $headers
* @param bool $secure
* @return \Illuminate\Http\RedirectResponse
* @static
*/
public static function intended($default = '/', $status = 302, $headers = array(), $secure = null)
{
return \Illuminate\Routing\Redirector::intended($default, $status, $headers, $secure);
}
示例5: redirectToIntended
/**
* Create a new redirect response to the previously intended location.
*
* @param string $default
* @param int $status
* @param array $headers
* @param bool $secure
* @return \Symfony\Component\HttpFoundation\Response
*/
public function redirectToIntended($default = '/', $status = 302, $headers = array(), $secure = null)
{
return $this->redirector->intended($default, $status, $headers, $secure);
}