How does laravel5 log on to the page before logon?

Source: Internet
Author: User
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 );}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.