PHPackages                             zhulei-nj/manager - 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. zhulei-nj/manager

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

zhulei-nj/manager
=================

Easily add new or override built-in providers in Laravel Socialite.

V1.0.1(9y ago)0221MITPHP ^5.6 || ^7.0

Since Dec 20Compare

[ Source](https://github.com/zhulei-nj/manager)[ Packagist](https://packagist.org/packages/zhulei-nj/manager)[ RSS](/packages/zhulei-nj-manager/feed)WikiDiscussions Synced 2w ago

READMEChangelog (1)Dependencies (3)Versions (2)Used By (1)

manager
=======

[](#manager)

Easily add new or override built-in providers in Laravel Socialite

A package for Laravel Socialite that allows you to easily add new providers or override current providers.

Benefits

You will have access to all of the providers that you load in using the manager. Instantiation is deferred until Socialite is called You can override current providers You can create new providers Lumen usage is easy stateless() can be set to true or false You can override a config dynamically It retrieves environment variables directly from the .env file instead of also having to configure the services array. Available Providers

See the zhulei-nj list You can also make your own or modify someone else's Reference

Laravel docs about events Laracasts video on events in Laravel 5 Laravel Socialite Docs Laracasts Socialite video Creating a Handler

Below is an example handler. You need to add this full class name to the listen\[\] in the EventServiceProvider.

See also the Laravel docs about events. providername is the name of the provider such as meetup. You will need to change your the namespacing and class names of course. namespace Your\\Name\\Space;

use zhulei\\Manager\\SocialiteWasCalled;

class ProviderNameExtendSocialite { public function handle(SocialiteWasCalled $socialiteWasCalled) { $socialiteWasCalled-&gt;extendSocialite('providername', \\Your\\Name\\Space\\Provider::class); } } Creating a Provider

Look at the already created providers for inspiration. See this article on Medium Overriding a Built-in Provider

You can easily override a built-in laravel/socialite provider by creating a new one with exactly the same name (i.e. 'facebook').

Dynamically Passing a Config

You can dynamically pass a config by using:

$clientId = "secret"; $clientSecret = "secret"; $redirectUrl = ""; $additionalProviderConfig = \['site' =&gt; 'meta.stackoverflow.com'\]; $config = new \\zhulei\\Manager\\Config($clientId, $clientSecret, $redirectUrl, $additionalProviderConfig); return Socialite::with('provider-name')-&gt;setConfig($config)-&gt;redirect(); You must call this before you run any Socialite methods.

Creating an OAuth1 Server Class

Take a look at the other OAuth1 providers for inspiration.

Getting the Access Token Response Body

Laravel Socialite by default only allows access to the access\_token. Which can be accessed via the \\Laravel\\Socialite\\User-&gt;token public property. Sometimes you need access to the whole response body which may contain items such as a refresh\_token.

To make this possible, the OAuth2 provider class needs to extend \\zhulei\\Manager\\OAuth2\\AbstractProvider and OAuth1 providers need to utilize the \\zhulei\\Manager\\OAuth1\\AbstractProvider and \\zhulei\\Manager\\OAuth1\\Server.

You can access it from the user object like so: $user-&gt;accessTokenResponseBody

###  Health Score

25

—

LowBetter than 35% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community5

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

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.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

3525d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/20158952?v=4)[Thor](/maintainers/zhulei-nj)[@zhulei-nj](https://github.com/zhulei-nj)

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/zhulei-nj-manager/health.svg)

```
[![Health](https://phpackages.com/badges/zhulei-nj-manager/health.svg)](https://phpackages.com/packages/zhulei-nj-manager)
```

###  Alternatives

[unopim/unopim

UnoPim Laravel PIM

10.8k2.5k](/packages/unopim-unopim)[socialiteproviders/manager

Easily add new or override built-in providers in Laravel Socialite.

42649.8M605](/packages/socialiteproviders-manager)[leantime/leantime

Open source project management system for non-project managers. Simple like Trello, powerful like Jira. Built with neurodiversity in mind.

11.3k4.0k](/packages/leantime-leantime)[dutchcodingcompany/filament-socialite

Social login for Filament through Laravel Socialite

2201.2M13](/packages/dutchcodingcompany-filament-socialite)[nasirkhan/laravel-starter

A CMS like modular Laravel starter project.

1.4k2.7k](/packages/nasirkhan-laravel-starter)[chrisreedio/socialment

Provides Socialite functionality for Filament.

108108.6k2](/packages/chrisreedio-socialment)

PHPackages © 2026

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