Answer the question
In order to leave comments, you need to log in
Laravel how to redirect to previous page?
laravel standard login. How to make it so that when going to the authorization page, remember request()->server('HTTP_REFERER') and pass the variable to
protected function redirectTo()
{
return url( переменная );
}
Answer the question
In order to leave comments, you need to log in
The question was solved as follows:
For authorization:
In the login form template, add
Add to LoginController
protected function redirectTo(){
return url($_REQUEST['httpref']);
}
use AuthenticatesUsers {
logout as performLogout;
}
public function logout(Request $request)
{
$this->performLogout($request);
return redirect($_SERVER['HTTP_REFERER']);
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question