mercredi 2 septembre 2015

laravel 5.0 Facebook login. get Locale data.

I can use the laravel 5.0, it has created the ability to login to facebook. We were able to log in, because profile information remains the default, We want to increase the acquired items can be.

In the standard, id, Nickname, Name, Email, Avatar, but is a token,

Gender, I am birthday, I want to get the name of the locale (the name of the language representation other than English).

AuthController.php

public function redirectToProvider()
{
    return Socialize::with('facebook')->redirect();
}

public function handleProviderCallback()
{
    $userData = Socialize::with('facebook')->user();

    $user = User::firstOrCreate([
                'name' => $userData->getName(),
                'email'    => $userData->getEmail(),
        ]);

    Auth::login($user);
    $user->photo = $userData->getAvatar();
    $user->access_token = $userData->token;

    $user->confirm();
    $user->save();

    return redirect('/');
}

It can be seen more, please tell me.



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/1JO2B86
via IFTTT

Aucun commentaire:

Enregistrer un commentaire