A package for Laravel Socialite that allows you to easily add new providers or override current providers.
- 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
- See the SocialiteProviders list
- You can also make your own or modify someone else's
- Laravel docs about events
- Laracasts video on events in Laravel 5
- Laravel Socialite Docs
- Laracasts Socialite video
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 asmeetup
.- You will need to change your the namespacing and class names of course.
namespace Your\Name\Space;
use SocialiteProviders\Manager\SocialiteWasCalled;
class ProviderNameExtendSocialite
{
public function handle(SocialiteWasCalled $socialiteWasCalled)
{
$socialiteWasCalled->extendSocialite('providername', 'Your\Name\Space\ProviderName');
}
}
- Look at the already created providers for inspiration.
- See this article on Medium
You can easily override a built-in laravel/socialite
provider by creating a new one with exactly the same name (i.e. 'facebook').