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.
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
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