MYHOSPITALNOW.COM

Find Trusted Doctors & Hospitals

Discover healthcare providers, compare hospitals, and explore treatment options worldwide.

Free Treatment Quotes • Doctor Search • Hospital Comparison

Find Healthcare Options

www.myhospitalnow.com

Laravel Social Login using Socialite

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';
     }Code language: PHP (php)

Find Trusted Cardiac Hospitals

Compare heart hospitals by city and services — all in one place.

Explore Hospitals
I'm Rajesh Kumar, a DevOps, SRE, DevSecOps, Cloud, and Platform Engineering expert passionate about sharing practical knowledge, real-world experiences, and industry best practices. I have worked at Cotocus and regularly write about technology, travel, investing, health, product reviews, and digital marketing through my various platforms. I publish technical articles at DevOps School, travel stories at Holiday Landmark, stock market insights at Stocks Mantra, health and fitness guidance at My Medic Plus, product reviews at TrueReviewNow, and SEO and digital marketing strategies at Wizbrand.

Related Posts

Single Sign-On Implementations: Practical Comparison and Evaluation Guide

This guide expands a short 2015 link list of SSO tools into a practical DevOps reference. You will learn how SSO flows work, how to compare implementations, and how to validate integrations with real commands.

Read More

Complete Tutorial: JWT (JSON Web Token) & OIDC (OpenID Connect)

1. 🔎 What is JWT? Definition Structure 2. 🔎 What is OIDC? Definition Key OIDC Tokens 3. ❓ Why do we need them? JWT OIDC 4. ⚙️…

Read More

Laravel: oauth_access_tokens clean up process

using Laravel Passport—the oauth_access_tokens table balloons when tokens aren’t expiring, not being revoked on logout, or not being purged. Here’s a practical, safe cleanup + prevention plan…

Read More

Keyclock: A Identity & SSO tools

Keycloak: Identity & SSO Tool (IAM in one box) What it is Keycloak is an open-source Identity and Access Management (IAM) platform that provides Single Sign-On (SSO),…

Read More

Laravel: Complete Guide of Laravel Passport

Here’s a comprehensive, up-to-date step-by-step tutorial for setting up and using Laravel Passport (OAuth2 API authentication) with clear explanations, working code samples, and troubleshooting tips—suitable for local…

Read More

artisan Tutorials: php artisan passport

When you run php artisan passport:install, Laravel attempts to do the following: Running php artisan passport:install is a crucial setup step when using Laravel Passport for API…

Read More