Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

LearnWithMoin's avatar

Auth::guard not creating session in Laravel Livewire

I created a multi-guard authentication login. When i try to log in, Auth::guard is not authenticated. Here is the code:

public function login(Request $request){
        $credentials = [
            'email' => $this->email,
            'password' => $this->password,
        ];

        if(Auth::guard('seller')->attempt($credentials)){
            $request->session()->regenerate();
            return redirect()->route('sellerdashboard');
        }else{
            session()->flash('loginmsg', 'Login Failed! Invalid Email or Password');
        }
    }
0 likes
2 replies
LearnWithMoin's avatar

@martinbean Thanks, man. I remove the guard from the application and developed multi-role authentication

1 like

Please or to participate in this conversation.