The
redirect
function returns a redirect HTTP response, or returns the redirector instance if called with no arguments:<?php return redirect($to = null, $status = 302, $headers = [], $https = null);
return redirect('/home');
return redirect()->route('route.name');
<?php abort(403);
}
abort(redirect($this->getLoginUrl()));
}
protected function getLoginUrl()
<?php protected function redirect()
{
return redirect($this->tokenData['url']);
}
}
<?php {
$url = $this->getPasswordFormUrl().'?token='.$this->generateToken();
abort(redirect($url));
}
protected function getPasswordFormUrl()
<?php return new JsonResponse(['message' => trans($response)], 200);
}
return redirect($this->redirectPath())
->with('status', trans($response));
}
<?php ]);
}
return redirect()->back()
->withInput($request->only('email'))
->withErrors(['email' => trans($response)]);
}
<?php session()->flash('user.forgot_password.success', __(Password::RESET_LINK_SENT));
$redirect = $request->has('_redirect')
? redirect($request->input('_redirect'))
: back();
return $request->wantsJson()
<?php protected function sendResetLinkFailedResponse(Request $request, $response)
{
$redirect = $request->has('_error_redirect')
? redirect($request->input('_error_redirect'))
: back();
if ($request->wantsJson()) {
<?php {
auth()->logout();
abort(redirect($this->params->get('redirect', '/'), $this->params->get('response', 302)));
}
<?php {
return $request->expectsJson()
? response()->json(['message' => $this->getMessage()], 401)
: redirect()->route('statamic.cp.login');
}
}
<?php protected function renderException($request, $e)
{
if ($e instanceof IlluminateAuthException && ! $request->expectsJson()) {
return redirect($this->getAuthExceptionRedirectUrl())->withError($e->getMessage());
}
return parent::render($request, $e);
<?php {
public function show($container)
{
return redirect()->cpRoute('assets.browse.show', $container->handle());
}
public function index(Request $request)
<?php $this->redirectToFirstContainer();
if (User::current()->can('create', AssetContainerContract::class)) {
return redirect()->cpRoute('assets.index');
}
throw new AuthorizationException;
<?php return;
}
abort(redirect($containers->first()->showUrl()));
}
}
<?php return;
}
return redirect(Statamic::cpAssetUrl('img/filetypes/'.$this->asset->extension().'.png'));
}
}
<?php {
return $request->expectsJson()
? response('Authenticated')
: redirect()->intended($this->redirectPath());
}
protected function credentials(Request $request)