I'm using Socialite to log with Social networks on my platform. The data are inserted into my database but I'm not logged in...
This is my controller :
$socialProvider = SocialProvider::where('provider_id',$socialUser->getId())->first();
$user = $socialProvider->user;
dd($user);
auth()->login($user);
The dd($user) give me :
User {#548 ▼
#table: "users"
#guarded: array:1 [▶]
#fillable: array:24 [▶]
#hidden: array:2 [▶]
#dates: array:1 [▶]
#persistableKey: "user_id"
#persistableRelationship: "persistences"
#loginNames: array:1 [▶]
#connection: null
#primaryKey: "id"
#keyType: "int"
+incrementing: true
#with: []
#perPage: 15
+exists: true
+wasRecentlyCreated: false
#attributes: array:26 [▶]
#original: array:26 [▶]
#casts: []
#dateFormat: null
#appends: []
#events: []
#observables: []
#relations: []
#touches: []
+timestamps: true
#visible: []
#permissionsInstance: null
#rememberTokenName: "remember_token"
#forceDeleting: false
}
I change the login call for : Auth::login($user, true); but still not working.