本文整理汇总了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);
}