gridplay / gpaone
GridPlay OAuth2 Provider for Laravel Socialite
Requires
- php: ^8.2
- ext-json: *
- guzzlehttp/guzzle: 7.*
- illuminate/support: ^11.0 | ^12.0
- socialiteproviders/manager: ^4.5
README
Installation & Basic Usage
To use first install with composer
"require": { "gridplay/gpaone": "^1.0", }
composer update
or do...
composer require gridplay/gpaone
Add configuration to config/services.php
'gpaone' => [ 'client_id' => env('GPAONE_CLIENT_ID'), 'client_secret' => env('GPAONE_CLIENT_SECRET'), 'redirect' => env('GPAONE_REDIRECT_URI') ],
Add provider event listener
Laravel 10 and below
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 \GPAONE\GPAOneExtendSocialite::class.'@handle', ], ];
Laravel 11+
In your Providers/AppServiceProvider.php put the following in the boot function
use Illuminate\Support\Facades\Event; use \GPAONE\Provider as GpaOneProvider; public function boot(): void { Event::listen(function (\SocialiteProviders\Manager\SocialiteWasCalled $event) { $event->extendSocialite('gpaone', GpaOneProvider::class); }); }
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('gpaone')->redirect();
$user = Socialite::driver('gpaone')->user(); $gpid = $user->id; $grid = $user->grid; // etc.
Returned User fields
id
grid
name
uuid
avatar
avis
avatar field is a full URL to the user's profile picture
avis is a list of SecondLife avatars linked to the GPaONE account List is...
- slid
- name
Facade Features!
isPrem($uuid)
$isprem = GPa::isPrem($uuid);
This lets you offer premium only stuff on your site for our GPPremium users
isBanned($uuid)
$isbanned = GPa::isBanned($uuid);
This lets you denie access to your site/services if the sl avatar is banned in the GridPlay system
Both functions returns a true/false boolean
Any issues and/or comments please reach out to VenKellie.Resident in SecondLife