Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Sync Facebook Profile Picture to User's avatar
<?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