DEV Community

Discussion on: Multiple Authentication in laravel 6x

Collapse
 
msamgan profile image
Mohammed Samgan Khan

the easiest way to do this to use the authenticated event which is fired after the authentication take place.

in you LoginController add

   /**
     * @param Request $request
     * @param $user
     * @return RedirectResponse
     */
    protected function authenticated(Request $request, $user)
    {
        if ($user->role === "ADMIN") {
            return redirect('/admin-page');
        }

        return redirect('/user-page');
    }