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

后端 未结 10 1908
终归单人心
终归单人心 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:37

    For Laravel 5.4 You can set protected $redirectTo = '/'; in LoginController.php FILE. Or in RegistersUsers.php file you can

    protected function registered(Request $request, $user)
    {
        return redirect('tosomeRoute'); 
        //Note: This code will run when
        //The user has been registered
    }
    

提交回复
热议问题