How to change default redirect URL of Laravel 5 Auth filter?

后端 未结 10 1928
终归单人心
终归单人心 2020-12-04 20:17

By default if I am not logged and I try visit this in browser:

http://localhost:8000/home

It redirect me to http://localhost:8000/aut

10条回答
  •  广开言路
    2020-12-04 20:35

    This is Laravel 5.4 Solution:

    There is a new unauthenticated() method in app/Exceptions/Handler.php which handles unauthenticated users and redirects to login path.

    So change

    return redirect()->guest('login');
    

    to

    return redirect()->guest('auth/login');
    

提交回复
热议问题