PHPackages                             peal/laravel-social-login - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. peal/laravel-social-login

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

peal/laravel-social-login
=========================

Laravel social login through facebook,google,github

v1.1.5(6y ago)16MITPHPCI failing

Since Nov 27Pushed 6y ago1 watchersCompare

[ Source](https://github.com/moin786/laravel-peal-socialLogin)[ Packagist](https://packagist.org/packages/peal/laravel-social-login)[ RSS](/packages/peal-laravel-social-login/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependencies (4)Versions (7)Used By (0)

laravel-social-login
====================

[](#laravel-social-login)

Laravel social OAuth2 login using google,facebook and github
=============================================================

[](#laravel-social-oauth2-login-using-googlefacebook-and-github-)

Using this package you can login with facebook, google and github, just create an app with facebook, google and github and setup your clientid,appid,clientsecret into your configuration file, after that setup clientid and client\_secret into your application .env file .

### Installation

[](#installation)

Inside your project root directory, open your terminal

```
composer require peal/laravel-social-login
```

Composer will automatically download laravel-social-login, then run below command from your command prompt running from project root, then socialConfig.php file will be placed into application config folder.

```
$ php artisan vendor:publish

 Which provider or tag's files would you like to publish?:
  [0 ] Publish files from all providers and tags listed below
  [1 ] Provider: Facade\Ignition\IgnitionServiceProvider
  [2 ] Provider: Fideloper\Proxy\TrustedProxyServiceProvider
  [3 ] Provider: Illuminate\Foundation\Providers\FoundationServiceProvider
  [4 ] Provider: Illuminate\Mail\MailServiceProvider
  [5 ] Provider: Illuminate\Notifications\NotificationServiceProvider
  [6 ] Provider: Illuminate\Pagination\PaginationServiceProvider
  [7 ] Provider: Laravel\Tinker\TinkerServiceProvider
  [8 ] Provider: peal\socialLogin\LoginServiceProvider
  [9 ] Tag: flare-config
  [10] Tag: ignition-config
  [11] Tag: laravel-errors
  [12] Tag: laravel-mail
  [13] Tag: laravel-notifications
  [14] Tag: laravel-pagination
 > 8
```

Openup your socialConfig.php file inside config folder and change your call\_back\_url or redirect\_url localhost to production url.

```
return [
    'facebook' => [
        'app_id' => env('FACEBOOK_APP_ID'), //Don't change
        'app_secret' => env('FACEBOOK_APP_SECRET'), //Don't change
        'default_graph_version' => 'v2.6',
        'call_back_url' => 'http://localhost:8000/facebook-success', //Put your production call back url
        'scope' => [
            'email'
        ]
    ],
    'google' => [
        'application_name' => 'your-application-name',
        'client_id' => env('GOOGLE_CLIENT_ID'), //Don't change
        'client_secret' => env('GOOGLE_CLIENT_SECRET'), //Don't change
        'redirect_url' => 'http://localhost:8000/google-success', //Put your production redirect url
        'scope' => [
            'https://www.googleapis.com/auth/plus.me',
            'https://www.googleapis.com/auth/userinfo.email',
            'https://www.googleapis.com/auth/userinfo.profile',
        ]
    ],
    'github' => [
        'client_id' => env('GITHUB_CLIENT_ID'), //Don't change
        'client_secret' => env('GITHUB_CLIENT_SECRET'), //Don't change
        'authorize_url' => 'https://github.com/login/oauth/authorize',
        'token_url' => 'https://github.com/login/oauth/access_token',
        'api_url_base' => 'https://api.github.com/',
        'call_back_url' => 'http://localhost:8000/gitloginsuccess' //Put your production call back url
    ],
];
```

### Put below environment variable inside .env file

[](#put-below-environment-variable-inside-env-file)

```
#Facebook Login
FACEBOOK_APP_ID=
FACEBOOK_APP_SECRET=

#Google Login
GOOGLE_CLIENT_ID=
GOOGLE_CLIENT_SECRET=

#Github Login
GITHUB_CLIENT_ID=
GITHUB_CLIENT_SECRET=
```

#### For Laravel Old version

[](#for-laravel-old-version)

After complete the installation, open your app.php from config folder, paste below line inside providers array, if you are using old laravel version.

```
peal\socialLogin\LoginServiceProvider::class,
```

### For Laravel version befor Auto Discovery

[](#for-laravel-version-befor-auto-discovery)

For Facade support , paste below line inside aliases array

```
'FacebookLogin' => peal\socialLogin\Facades\FacebookLogin::class,
```

```
'GoogleLogin' => peal\socialLogin\Facades\GoogleLogin::class,
```

```
'GithubLogin' => peal\socialLogin\Facades\GithubLogin::class,
```

### USAGES (Inside your route or controller)

[](#usages-inside-your-route-or-controller)

```
    Route::get('gitauthorize', function(){

        GithubLogin::getClientId();
        GithubLogin::getRedirectUri();
        return GithubLogin::getAuthorizeURL();
    });

    Route::get('gitloginsuccess', function(Request $request){
        $access_token = GithubLogin::getAccessToken($request);

        //Save this information into your database user table
        return GithubLogin::gitHubApiCall($access_token);
    });

    Route::get('facebookLogin', function(){
        FacebookLogin::getCallBackUrl();
        FacebookLogin::getScope();
        $login_url = FacebookLogin::getLoginUrl();
        return redirect($login_url);
    });

    Route::get('facebook-success', function(){
        //Save this information into your database user table
        return FacebookLogin::getOAuth2Client();
    });

    Route::get('googleLogin', function(){
        GoogleLogin::getScopes();
        return GoogleLogin::gotoAuthUrl();
    });

    Route::get('google-success', function(Request $request){

        if ($request->has('code') && empty($request->get('state'))) {
            //return GoogleLogin::getAccessToken(trim($request->get('code')));

            //Save this information into your database user table
            return $userinfo = GoogleLogin::clientLogin(trim($request->get('code')));
        }
    });
```

### Author

[](#author)

[Mohammed Minuddin(Peal)](https://moinshareidea.wordpress.com)

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

6

Last Release

2357d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/171ff00d2636607267851b5600ddb93bdeb77b62dca6f1b6c031dd6f40a3753d?d=identicon)[moin786](/maintainers/moin786)

---

Top Contributors

[![moin786](https://avatars.githubusercontent.com/u/12525167?v=4)](https://github.com/moin786 "moin786 (6 commits)")

---

Tags

facebookfacebooklogingithubgithublogingooglegoogleloginloginsocailsocialloginlaravelloginSocial LoginFacebook loginGoogle logingithub login

### Embed Badge

![Health badge](/badges/peal-laravel-social-login/health.svg)

```
[![Health](https://phpackages.com/badges/peal-laravel-social-login/health.svg)](https://phpackages.com/packages/peal-laravel-social-login)
```

###  Alternatives

[zefy/laravel-sso

Simple PHP SSO integration for Laravel

1013.0k](/packages/zefy-laravel-sso)[vinelab/social-auth

101.3k1](/packages/vinelab-social-auth)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
