Reputation:
I'm using Facebook login
with Socialite
which is dumping
the user as shown below.
dd($user);
output:
How to get user
details from above object
shown in image?
i'm trying to access like this but getting error
$user = Socialite::driver('facebook')->user();
dd($user->user[0],$user->user[1],$user->user[2],$user->user[3],$user->user[4]);
Upvotes: 2
Views: 75
Reputation: 6006
use like this to get the user data array from the socialite result
$providerUser = Socialite::driver('facebook')->user();
$user=json_decode(json_encode($providerUser,true),true);
$user=$user['user'];
Upvotes: 3