laravel-boilerplates / socialite
A boilerplate for the SocialiteProviders/Manager package with auth scaffolding.
Fund package maintenance!
:vendor_name
Requires
- php: ^8.0
- illuminate/contracts: ^8.37
- laravel/socialite: ^5.2
- owenvoke/blade-fontawesome: ^1.9
- socialiteproviders/manager: ^4.0
- spatie/laravel-package-tools: ^1.4.3
Requires (Dev)
- nunomaduro/collision: ^5.3
- orchestra/testbench: ^6.15
- pestphp/pest: ^1.18
- pestphp/pest-plugin-laravel: ^1.1
- spatie/laravel-ray: ^1.23
- vimeo/psalm: ^4.8
README
This package provides auth boilerplate for the SocialiteProviders\Manager package.
Installation
You can install the package via composer:
composer require laravel-boilerplates/socialite
You can publish and run the migrations with:
php artisan vendor:publish --provider="LaravelBoilerplates\Socialite\SocialiteServiceProvider" --tag="socialite-migrations" php artisan migrate
Configuration
You can publish the config file with:
php artisan vendor:publish --provider="LaravelBoilerplates\Socialite\SocialiteServiceProvider" --tag="socialite-config"
This is the contents of the published config file:
return [ 'storeTokens' => env('SOCIALITE_STORE_TOKENS', true), ];
Typical configuration of Socialite still applies. config/services.php
'microsoft' => [ 'client_id' => env('MICROSOFT_CLIENT_ID'), 'client_secret' => env('MICROSOFT_CLIENT_SECRET'), 'redirect' => env('MICROSOFT_REDIRECT_URI') ],
Usage
use Laravel\Socialite\Facades\Socialite; return Socialite::driver('microsoft')->redirect();
The following routes are published:
Route::group(['middleware' => ['web', 'guest']], function () { Route::get('/auth/{provider}/redirect', [SocialSessionController::class, 'create'])->name('social.login'); Route::get('/auth/{provider}/callback', [SocialSessionController::class, 'store']); Route::get('/register/{provider}', [RegisteredSocialUserController::class, 'index'])->name('social.register.approve'); Route::get('/register/{provider}/redirect', [RegisteredSocialUserController::class, 'create'])->name('social.register'); Route::get('/register/{provider}/callback', [RegisteredSocialUserController::class, 'store']); });
Testing
composer test
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
The MIT License (MIT). Please see License File for more information.