Created
October 3, 2012 12:20
-
-
Save crynobone/3826646 to your computer and use it in GitHub Desktop.
Sync Facebook Profile Picture to User's avatar
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
Event::listen('oneauth.logged', function ($client, $user_data) | |
{ | |
if ($client->user_id > 0) | |
{ | |
// get user information using eloquent. | |
$user = User::find($client->user_id); | |
$user->avatar = $user_data['info']['image']; | |
$user->save(); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment