SocialiteProviders / Laravel-Passport by m1guelpf

LaravelPassport OAuth2 Provider for Laravel Socialite
687,997
49
3
Package Data
Maintainer Username: m1guelpf
Maintainer Contact: recca0120@name.com (recca0120)
Package Create Date: 2018-01-29
Package Last Update: 2024-11-07
Home Page: https://socialiteproviders.com/Laravel-Passport/
Language: PHP
License: MIT
Last Refreshed: 2024-11-17 03:09:26
Package Statistics
Total Downloads: 687,997
Monthly Downloads: 21,317
Daily Downloads: 82
Total Stars: 49
Total Watchers: 3
Total Forks: 9
Total Open Issues: 0

LaravelPassport

composer require socialiteproviders/laravelpassport

Installation & Basic Usage

Please see the Base Installation Guide, then follow the provider specific instructions below.

Add configuration to config/services.php

'laravelpassport' => [    
  'client_id' => env('LARAVELPASSPORT_CLIENT_ID'),  
  'client_secret' => env('LARAVELPASSPORT_CLIENT_SECRET'),  
  'redirect' => env('LARAVELPASSPORT_REDIRECT_URI'),
  'host' => env('LARAVELPASSPORT_HOST'),
],

Add provider event listener

Configure the package's listener to listen for SocialiteWasCalled events.

Add the event to your listen[] array in app/Providers/EventServiceProvider. See the Base Installation Guide for detailed instructions.

protected $listen = [
    \SocialiteProviders\Manager\SocialiteWasCalled::class => [
        // ... other providers
        \SocialiteProviders\LaravelPassport\LaravelPassportExtendSocialite::class.'@handle',
    ],
];

Usage

You should now be able to use the provider like you would regularly use Socialite (assuming you have the facade installed):

return Socialite::driver('laravelpassport')->redirect();

Returned User fields

  • id
  • nickname
  • name
  • email
  • avatar