Download the PHP package kneu/laravel-socialite-provider without Composer
On this page you can find all versions of the php package kneu/laravel-socialite-provider. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package laravel-socialite-provider
KNEU Laravel Socialite
KNEU Provider for Laravel Socialite Providers.
Installation
1. Composer
Add package to your laravel project via composer
composer require kneu/laravel-socialite-provider
2. Add service provider
- Remove
Laravel\Socialite\SocialiteServiceProvider
from yourproviders[]
array inconfig\app.php
if you have added it already. - Add
\SocialiteProviders\Manager\ServiceProvider::class
to yourproviders[]
array inconfig\app.php
.
For example:
3. Add the Event and Listeners
-
Add
SocialiteProviders\Manager\SocialiteWasCalled
event to yourlisten[]
array in<app_name>/Providers/EventServiceProvider
. - Add listener
'\SocialiteProviders\Kneu\KneuExtendSocialite@handle'
to theSocialiteProviders\Manager\SocialiteWasCalled[]
.
For example:
3. Add configuration to config/services.php
4. Environment Variables
Append provider values to your .env
file
Basic Usage
Next, you are ready to authenticate users via KNEU! You will need tree routes:
- first for redirecting the user to the KNEU OAuth provider
- second for receiving the callback from the KNEU provider after authentication
- third for logout.
Example of Controller
Of course, you will need to define routes to your controller methods:
Retrieving User Details
Once you have a user instance, you can grab a few more details about the user:
More details
See documentation for Laravel Socialite Providers.