What happened to Laravel's redirectTo() method?

后端 未结 4 850
悲哀的现实
悲哀的现实 2021-02-07 12:21

We can override this property to redirect users after login in LoginController:

protected $redirectTo = \'/home\';

And here is the statement fr

4条回答
  •  滥情空心
    2021-02-07 12:45

    redirectTo redirects users that complete login or registration. Users who are already logged in and try to register or log in again will be redirected by app/Http/Middleware/RedirectIfAuthenticated.php

    if (Auth::guard($guard)->check()) {
        return redirect('/home');
    }
    

提交回复
热议问题