Support the ongoing development of →
Authentication Session Database
Last updated 7 months ago.

Dump&Die the $user variable. Its a array of POPObjects. You can not pass it into Auth::login(User $user). So, you need to extract the id of the user and pass it to Auth::loginUsingId(int $id)

Here is a Eloquent example :

$user = User::whereEmail($result['email'])->first(['id']);

if (empty($user)) {
    $user = new User;


Also note that you require $user variable but you are creating user as $data variable which is also why you getting errors.

Last updated 7 months ago.

Thank you :) It's working now

Last updated 7 months ago.

@mcraz Just noted that it shows this error: Argument 1 passed to Illuminate\Auth\Guard::login() must implement interface Illuminate\Auth\UserInterface, null given when user is logged in for the first time. And then when page is refreshed user is logged in.

Last updated 7 months ago.

Sign in to participate in this thread!


Your banner here too?

laureta laureta Joined 17 Apr 2014


We'd like to thank these amazing companies for supporting us

Your logo here?

The Laravel portal for problem solving, knowledge sharing and community building.

© 2022 - All rights reserved.