After logon, the home page is displayed. How does one jump to the previous page (the page before logon) (the page before logon is displayed to the home page )? It is not good to jump to the home page every time. The user still waits to go backwards or find the previous page in the history record {code...} After logging on, it is always after the jump/home. How to jump to the previous page (
Page before Logon
)/(Jump to the page before Logon
home
)?
It is not very good to jump to home every time. The user will wait for the page to go backwards or find the previous history.
public function handle($request, Closure $next) { if ($this->auth->check()) { return redirect('/home'); } return $next($request); }
Reply content:
After logging on, they are all redirected to/home. How to jump to the previous page (Page before Logon
)/(Jump to the page before Logonhome
)?
It is not very good to jump to home every time. The user will wait for the page to go backwards or find the previous history.
public function handle($request, Closure $next) { if ($this->auth->check()) { return redirect('/home'); } return $next($request); }
So look?
public function handle($request, Closure $next) { if ($this->auth->check()) { return Redirect::intended('/'); //return redirect('/home'); } return $next($request); }
Public function handle ($ request, Closure $ next) {if ($ this-> auth-> check ()) {// jump to the/home Page return redirect ('/home'); // After Successful Logon, jump to the page before logon, but I usually use return redirect ()-> back (); // I usually use this method. After Successful Logon, I want to use the Controller return redirect () -> action ('indexcontroller @ Index');} return $ next ($ request );}