I’m having trouble with the recent facebook update with their API.
I was having an error that said
Laravel FacebookProvider Error. Undefined variable: access_token.
I found another question where they said to do this :
In vendor/laravel/socialite/src/Two/FacebookProvider.php
Replace
parse_str($body, $data);
return $access_token;
With
parse_str($body, $data);
$json = json_decode(key($data));
return $json->access_token;
After I made those changes, now i’m having this error
FatalErrorException in FacebookProvider.php line 67:
Cannot access empty property
Here’s the link : https://concoura.com
2
Answers
Never, ever modify vendor files. Instead, update your package through composer. This was fixed awhile ago as the
FacebookProvider
has changed greatly and utilizes a completely different method to retrieve and provide the access code.I had the same problem and I solved with
Tested with Laravel 5.2 and 5.3