chrisjk123 / laravel-social
Requires
- php: >=7.3|^8.0|^8.1
- illuminate/support: ^8.0|^9.0
- laravel/socialite: ^5.3
Requires (Dev)
- orchestra/testbench: ^7.6
- phpunit/phpunit: ^8.0|^9.0
README
This package serves as a quick, helpful wrapper around Laravel Socialite.
NOTE: all OAuth authentication logins made by Laravel Socialite are supported.
Installation
You can install the package via composer:
composer require chrisjk123/laravel-social
You can optionally publish the config file with:
php artisan vendor:publish --provider="Chriscreates\Social\Providers\SocialServiceProvider" --tag="social-config"
Be sure to update config\services.php
following Laravel Socialite's documentation.
<?php return [ // as an example: 'google' => [ 'client_id' => env('GOOGLE_CLIENT_ID'), 'client_secret' => env('GOOGLE_CLIENT_SECRET'), 'redirect' => env('GOOGLE_REDIRECT'), ], ];
Make sure your use Illuminate\Foundation\Auth\User as Authenticatable;
model is passwordless i.e. the password field is nullable.
Usage
To login with a given provider, simply pass in the provider name and have the user visit the route:
route('auth.provider.callback', ['provider' => 'google'])
Customization
The auth validation and creation process may be customized via "Action" classes. Be sure to review this repository's source code and read up on the Laravel Fortify docs as an example.
Contracts:
Chriscreates\Social\Contracts\SocialCreateAuthContract
Chriscreates\Social\Contracts\SocialFindAuthContract
Testing
composer test
Changelog
Please see CHANGELOG for more information what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please email christopherjk123@gmail.com instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.