This package serves as a quick, helpful wrapper around Laravel Socialite.
NOTE: all OAuth authentication logins made by Laravel Socialite are supported.
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.
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'])
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
composer test
Please see CHANGELOG for more information what has changed recently.
Please see CONTRIBUTING for details.
If you discover any security related issues, please email christopherjk123@gmail.com instead of using the issue tracker.
The MIT License (MIT). Please see License File for more information.