how can I get original avatar with socialite in laravel?

1.7k views Asked by At

I work with socialite in laravel 5.6

with this

$social_user = Socialite::driver($provider)->user();

and with dd($social_user)

results:

User {#799 ▼
  +token: "517439085-SQzlrx8Op"
  +tokenSecret: "8KnMz1K5WQ9lpg"
  +id: "5176085"
  +nickname: "test"
  +name: "test"
  +email: "[email protected]"
  +avatar: "http://pbs.twimg.com/profilermal.jpeg"
  +user: array:40 [▶]
  +"avatar_original": "http://pbs.twimg.com/profileyxeYC5.jpeg"
}

I could get name, id and...

 $social_user->getName();
 $social_user->getAvatar();
 $social_user->getId();

But how can I get avatar_original?

1

There are 1 answers

2
Alexey Mezenin On BEST ANSWER

Since the avatar and other properties are public, you can just access them using the standard syntax:

$social_user->avatar;