Slide 1
Excellent Education Program
Innovative Methods of Teaching

Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Cum sociis natoque penatibus et magnis dis parturient.

Slide 2
Learning Through Play
Devoted to the Early Education

Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. Nulla consequat massa quis enim.

Slide 2
Learning Through Play
Devoted to the Early Education

Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. Nulla consequat massa quis enim.

Slide 2
Learning Through Play
Devoted to the Early Education

Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. Nulla consequat massa quis enim.

Slide 2
Learning Through Play
Devoted to the Early Education

Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. Nulla consequat massa quis enim.

Slide 3
Learning Through Play
Find a Class for your Children

Aenean leo ligula, porttitor eu, consequat vitae, eleifend ac, enim. Aliquam lorem ante, dapibus in, viverra quis.

previous arrow
next arrow

Laravel Social Login using Socialite

Spread the Knowledge

Installations—- (laravel 5.5)
composer require laravel/socialite “^3.2.0”

configuration—–(config/services.php)

'facebook' => [
'client_id' => env('facebook_CLIENT_ID'), // Your facebook Client ID
'client_secret' => env('facebook_CLIENT_SECRET'), // Your facebook Client Secret
'redirect' => 'http://your-callback-url',
],

(Go—- https://developers.facebook.com)
–> go my app and generate Your new facebook Client ID and our facebook Client Secret ID and change
==> change app domain (localhost) and change Site URL (http://localhost:8000/) and click save button

(CONFIG/APE.PHP)– IN PROVIDERES
Laravel\Socialite\SocialiteServiceProvider::class,
'Socialite' => Laravel\Socialite\Facades\Socialite::class,

( App\Http\Controllers\Auth;)

/**
* Redirect the user to the facebook authentication page.
*
* @return \Illuminate\Http\Response
*/
public function redirectToProvider()
{
return Socialite::driver('facebook')->redirect();
}
/**
 * Obtain the user information from GitHub.
 *
 * @return \Illuminate\Http\Response
 */
public function handleProviderCallback()
{
    $user = Socialite::driver('facebook')->user();

    // $user->token;
}

(web.php)
Route::get('login/facebook', 'Auth\LoginController@redirectToProvider');
Route::get('login/facebook/callback', 'Auth\LoginController@handleProviderCallback');

after change in (services.php)
(http://your-callback-url) form 
http://localhost:8000/login/facebook/callback/

if you want show login, email, password then add this topic

 public function handleProviderCallback()
          {
              $user = Socialite::driver('facebook')->user();
            //return $userSocial->name;
              $findUser = User::where('email',$userSocial->email)->first();
              if ($findUser) {
                       Auth::login($finduser);
                  return 'done with old';
              }else{
              }
                  $user = new User;
                  $user->name = $userSocial->name;
                  $user->email = $userSocial->email;
                  $user->password = bcrypt('123456');
                  $user->save();
                  Auth::login($user);
                  return 'done with new';
     }
Ajay K
Follow me