Skip to content

laravel-fans/laravel-ui-socialite

Folders and files

NameName
Last commit message
Last commit date

Latest commit

e5476c3 · Sep 12, 2020

History

58 Commits
Sep 12, 2020
Sep 12, 2020
Sep 12, 2020
Sep 12, 2020
Sep 12, 2020
Jul 14, 2019
Jun 9, 2019
Sep 12, 2020
Sep 12, 2020
Oct 20, 2019
Oct 20, 2019
Aug 30, 2020
Sep 12, 2020

Repository files navigation

Laravel UI Socialite

Laravel 8 codecov LICENSE

Automatically generate database, pages, and routes for Laravel Socialite. Just like php artisan ui:auth.

Login with multiple providers using the same email will be determined as one user.

When logged in, you can link all providers to the current user, and login with them next time.

Special handling for WeChat.

install

composer require laravel-fans/ui-socialite
php artisan ui vue
php artisan ui:auth
php artisan ui:socialite
php artisan vendor:publish --provider="LaravelFans\UiSocialite\UiSocialiteServiceProvider"
php artisan migrate

config

add to config/services.php:

    'github' => [
        'client_id' => env('GITHUB_CLIENT_ID'),
        'client_secret' => env('GITHUB_CLIENT_SECRET'),
        'redirect' => env('GITHUB_CALLBACK_URL'),
        'scopes' => env('GITHUB_SCOPES'), // optional
    ],

add to .env:

AUTH_SOCIAL_LOGIN_PROVIDERS=Facebook,Twitter,Linkedin,Google,GitHub,GitLab,Bitbucket,wechat_web,wechat_service_account
GITHUB_CLIENT_ID=foo
GITHUB_CLIENT_SECRET=bar
GITHUB_CALLBACK_URL=http://127.0.0.1:8000/login/github/callback
GITHUB_SCOPES=user:email,public_repo

# disable password login
AUTH_PASSWORD_LOGIN_ENABLED=0

# disable register
AUTH_OPTIONS_REGISTER=0

screenshots

Laravel Socialite Login page GitHub OAuth Login Laravel Socialite Profile page and Linked Accounts Laravel Socialite link multiple providers to one user