PHPackages                             bleuren/socialite-unify - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. bleuren/socialite-unify

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

bleuren/socialite-unify
=======================

A Laravel package for LINE social authentication with Jetstream integration

014PHP

Since Mar 15Pushed 1y ago1 watchersCompare

[ Source](https://github.com/bleuren/socialite-unify)[ Packagist](https://packagist.org/packages/bleuren/socialite-unify)[ RSS](/packages/bleuren-socialite-unify/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Socialite Unify
===============

[](#socialite-unify)

A Laravel package that integrates multiple social platform logins and team management features with Jetstream.

Features
--------

[](#features)

- **Social Platform Login**: Supports LINE and other social platforms.
- **Multiple Account Binding**: Bind multiple social accounts to a single user.
- **Account Management**: Bind new social accounts, unbind existing ones, and log in with any bound account.
- **Jetstream Integration**: Overrides Jetstream's login, password update, and reset functionality to support `has_password`.
- **Team Management**: Inherits Jetstream's team management features.

Installation
------------

[](#installation)

1. Install the package via Composer:

```
composer require bleuren/socialite-unify
```

2. Add the service provider to `config/app.php` (if not using auto-discovery):

```
'providers' => [
    // ...
    Bleuren\SocialiteUnify\Providers\SocialiteServiceProvider::class,
],
```

3. Important: Comment out or remove the following Fortify actions in your `app/Providers/FortifyServiceProvider.php` to avoid conflicts with the package (if you are using the default Fortify actions in your application):

```
// app/Providers/FortifyServiceProvider.php
public function boot(): void
{
    // Remove or comment out these lines:
    // Fortify::createUsersUsing(CreateNewUser::class);
    // Fortify::updateUserPasswordsUsing(UpdateUserPassword::class);
    // Fortify::resetUserPasswordsUsing(ResetUserPassword::class);

    // Keep other Fortify configurations if needed:
    Fortify::updateUserProfileInformationUsing(UpdateUserProfileInformation::class);
    // ...
}
```

4. Publish the configurations, migrations and views:

```
php artisan vendor:publish --provider="Bleuren\SocialiteUnify\Providers\SocialiteServiceProvider"
```

This will publish:

- Configuration file to `config/socialite-unify.php`
- Migration files to `database/migrations`
- View files to `resources/views/vendor/socialite-unify`

To override Jetstream's password update form (required for social login functionality), you have two options:

1. Using the force publish command:

```
php artisan vendor:publish --provider="Bleuren\SocialiteUnify\Providers\SocialiteServiceProvider" --tag=views --force
```

2. Manually update the `resources/views/profile/update-password-form.blade.php` by adding the following conditions:

```

    @if(Auth::user()->has_password)

    @endif
```

4. Run the migrations:

```
php artisan migrate
```

5. Configure social platform credentials in your `.env` file and add the following to `config/services.php`:

```
LINE_CLIENT_ID=your-line-client-id
LINE_CLIENT_SECRET=your-line-client-secret
LINE_REDIRECT_URI=your-line-callback-url
```

```
// config/services.php
return [
    // ... other services
    'line' => [
        'client_id' => env('LINE_CLIENT_ID'),
        'client_secret' => env('LINE_CLIENT_SECRET'),
        'redirect' => env('LINE_REDIRECT_URI'),
        'bot_prompt' => env('LINE_BOT_PROMPT', 'normal'),
    ],
];
```

6. Update your `User` model to use the `HasSocialiteUnify` trait:

```
use Bleuren\SocialiteUnify\Traits\HasSocialiteUnify;

class User extends Authenticatable
{
    use HasSocialiteUnify;
    // ...
}
```

7. Add the social accounts form to your profile page (e.g., `resources/views/profile/show.blade.php`):

```

```

Usage
-----

[](#usage)

### Social Login

[](#social-login)

To enable social login, add the login buttons to your login page:

```
@foreach(['line'] as $provider)

            {{ __("Login with " . ucfirst($provider)) }}

@endforeach
```

### Managing Social Accounts

[](#managing-social-accounts)

Users can manage their social accounts from their profile page using the provided Livewire component. They can:

- Bind new social accounts
- Unbind existing social accounts (if they have a password or multiple social accounts)
- View all connected accounts

### Password Management

[](#password-management)

The package extends Jetstream's password management to handle users who registered via social login:

- Users who registered via social login will have `has_password = false`
- These users can set a password later from their profile
- Password reset and update flows are modified to handle the `has_password` state
- Users must have either a password or at least one social account

### Team Management

[](#team-management)

The package maintains Jetstream's team management features:

- Each new user gets a personal team
- Team creation and management work as in standard Jetstream
- Social login users are integrated into the team system

Database Changes (if it's not already done)
-------------------------------------------

[](#database-changes-if-its-not-already-done)

This package adds a `social_accounts` table with the following structure:

```
Schema::create('social_accounts', function (Blueprint $table) {
    $table->id();
    $table->foreignId('user_id')->constrained('users');
    $table->string('provider_name');
    $table->string('provider_id');
    $table->timestamps();
    $table->unique(['provider_name', 'provider_id']);
});
```

And adds a `has_password` boolean column to the users table:

```
Schema::table('users', function (Blueprint $table) {
    $table->boolean('has_password')->default(true)->after('password');
});
```

Requirements
------------

[](#requirements)

- PHP &gt;= 8.2
- Laravel &gt;= 12.0
- Laravel Jetstream &gt;= 5.0
- Laravel Socialite &gt;= 5.0
- Livewire &gt;= 3.0

Customization
-------------

[](#customization)

### Adding New Providers

[](#adding-new-providers)

By default, the package supports LINE. To add additional social platforms, you have two options:

#### Option 1: Using Configuration (Recommended)

[](#option-1-using-configuration-recommended)

1. Install the desired provider by following the instructions at [Socialite Providers](https://socialiteproviders.com/). For example, for Facebook:

```
composer require socialiteproviders/facebook
```

2. If you haven't published the configuration file yet, publish it first:

```
php artisan vendor:publish --provider="Bleuren\SocialiteUnify\Providers\SocialiteServiceProvider" --tag=config
```

3. Add the provider to your `config/socialite-unify.php`:

```
'providers' => ['line', 'facebook'],
```

4. Register the provider's event listener in your `AppServiceProvider.php` boot method:

```
Event::listen(function (\SocialiteProviders\Manager\SocialiteWasCalled $event) {
    $event->extendSocialite('facebook', \SocialiteProviders\Facebook\Provider::class);
});
```

5. Add the provider's credentials to your `.env` file and `config/services.php`.
6. Add the provider's translation to your language files. You have two options:

    **Option A: Publish all translation files** (recommended for first-time setup):

    ```
    php artisan vendor:publish --provider="Bleuren\SocialiteUnify\Providers\SocialiteServiceProvider" --tag=translations
    ```

    Then edit the published files to add your new provider.

    **Option B: Manually add translations** (recommended when adding new providers):

    ```
    // lang/vendor/socialite-unify/[locale]/socialite.php
    return [
        'providers' => [
            'line' => 'LINE',
            'facebook' => 'Facebook'
        ],
    ];
    ```

#### Option 2: Extending SocialiteManager (Legacy)

[](#option-2-extending-socialitemanager-legacy)

If you need more customization, you can extend the SocialiteManager class:

```
namespace App\Services;

use Bleuren\SocialiteUnify\Services\SocialiteManager;

class CustomSocialiteManager extends SocialiteManager
{
    // Add your custom providers here
    protected array $providers = ['line', 'facebook'];
}
```

Then register your CustomSocialiteManager in `AppServiceProvider`:

```
use Bleuren\SocialiteUnify\Contracts\SocialiteService;
use App\Services\CustomSocialiteManager;

public function register(): void
{
    $this->app->singleton(SocialiteService::class, CustomSocialiteManager::class);
}
```

### Views

[](#views)

You can publish and customize the views:

```
php artisan vendor:publish --provider="Bleuren\SocialiteUnify\Providers\SocialiteServiceProvider" --tag=views
```

This will publish the views to `resources/views/vendor/socialite-unify/`.

License
-------

[](#license)

This package is open-sourced software licensed under the [MIT license](LICENSE).

###  Health Score

16

—

LowBetter than 5% of packages

Maintenance34

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity15

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/cf3c779c1213d28ff1924f65f9d57af66208fc2ca47bd34bb6d1b42958bf2f00?d=identicon)[bleuren](/maintainers/bleuren)

---

Top Contributors

[![bleuren](https://avatars.githubusercontent.com/u/22718976?v=4)](https://github.com/bleuren "bleuren (8 commits)")

### Embed Badge

![Health badge](/badges/bleuren-socialite-unify/health.svg)

```
[![Health](https://phpackages.com/badges/bleuren-socialite-unify/health.svg)](https://phpackages.com/packages/bleuren-socialite-unify)
```

###  Alternatives

[namshi/jose

JSON Object Signing and Encryption library for PHP.

1.8k99.6M101](/packages/namshi-jose)[league/oauth1-client

OAuth 1.0 Client Library

99698.8M106](/packages/league-oauth1-client)[bezhansalleh/filament-shield

Filament support for `spatie/laravel-permission`.

2.8k2.9M88](/packages/bezhansalleh-filament-shield)[gesdinet/jwt-refresh-token-bundle

Implements a refresh token system over Json Web Tokens in Symfony

70516.4M35](/packages/gesdinet-jwt-refresh-token-bundle)[league/oauth2-google

Google OAuth 2.0 Client Provider for The PHP League OAuth2-Client

41721.2M119](/packages/league-oauth2-google)[illuminate/auth

The Illuminate Auth package.

9327.3M1.0k](/packages/illuminate-auth)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
