chrisjk123/laravel-social

v1.0.0 2022-08-22 19:25 UTC

This package is auto-updated.

Last update: 2024-04-22 22:55:12 UTC


README

Version MIT Licensed GitHub Tests Action Status

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.