Search code examples
phplaravel-5laravel-socialite

Laravel Socialite not returning user data


I configured Laravel Socialite and it was returning user data. I discovered that the data structure was changed. $user = Socialite::driver('facebook')->user(); is not returning name, email and avater. Please anyone know what happened to the facebook, google and twitter.

Here are snapshots of the providers:

Facebook Provider

Google Provider

So if any body have a solution to this or what am doing wrong. Please help.


Solution

  • I have fixed this issue by wrapping my callback method in a try catch block, then I recreated my CreateOrLogin class, it now accesses Socialite::driver('facebook')->user() directly as the documentation was stated.