Skip to content

Instantly share code, notes, and snippets.

@crynobone
Created October 3, 2012 12:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save crynobone/3826646 to your computer and use it in GitHub Desktop.
Save crynobone/3826646 to your computer and use it in GitHub Desktop.
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