Socialite Extender

Introduction

Extends Laravel Socialite with persistent token storage and advanced API integrations for Providers. Allows linking existing users to external accounts, performing post-login API actions.

Instalation

You can install the package via composer:

composer require zaimea/socialite-extender

or via composer.json

"repositories": [
        {
            "type": "vcs",
            "url": "https://github.com/zaimea/socialite-extender"
        }
    ]

1. Publish files (views, config)

php artisan vendor:publish --provider="Zaimea\SocialiteExtender\SocialiteExtenderServiceProvider" --tag=views
php artisan vendor:publish --provider="Zaimea\SocialiteExtender\SocialiteExtenderServiceProvider" --tag=config

2. Run migration

php artisan migrate

3. Include the Blade partial in the user's profile

@include('vendor.socialite-extender.profile.github-connect')
@include('socialite-extender::profile.github-connect')

4. User model should use the Zaimea\SocialiteExtender\Traits\HasSocialAccounts trait

use Zaimea\SocialiteExtender\Traits\HasSocialAccounts;

class User extends Authenticatable
{
    use HasSocialAccounts, HasApiTokens, HasFactory, Notifiable;
}