SocialiteProviders / Laravel-Passport by m1guelpf

LaravelPassport OAuth2 Provider for Laravel Socialite
553,669
40
3
Package Data
Maintainer Username: m1guelpf
Maintainer Contact: recca0120@name.com (recca0120)
Package Create Date: 2018-01-29
Package Last Update: 2024-04-01
Home Page: https://socialiteproviders.com/Laravel-Passport/
Language: PHP
License: MIT
Last Refreshed: 2024-04-28 15:00:13
Package Statistics
Total Downloads: 553,669
Monthly Downloads: 15,859
Daily Downloads: 87
Total Stars: 40
Total Watchers: 3
Total Forks: 8
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