https://github.com/rikodev/id
id.riko.dev socialite provider
https://github.com/rikodev/id
Last synced: 12 months ago
JSON representation
id.riko.dev socialite provider
- Host: GitHub
- URL: https://github.com/rikodev/id
- Owner: RikoDEV
- Created: 2024-05-13T19:51:50.000Z (about 2 years ago)
- Default Branch: master
- Last Pushed: 2024-05-14T20:44:55.000Z (about 2 years ago)
- Last Synced: 2025-02-25T05:16:19.621Z (over 1 year ago)
- Language: PHP
- Size: 4.88 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Internal RikoDEV ID socialite provider
## Installation & Basic Usage
Please see the [Base Installation Guide](https://socialiteproviders.com/usage/), then follow the provider specific instructions below.
### Add configuration to `config/services.php`
```php
'discord' => [
'client_id' => env('RIKOID_CLIENT_ID'),
'client_secret' => env('RIKOID_CLIENT_SECRET'),
'redirect' => env('RIKOID_REDIRECT_URI'),
],
```
### Add provider event listener
#### Laravel 11+
In Laravel 11, the default `EventServiceProvider` provider was removed. Instead, add the listener using the `listen` method on the `Event` facade, in your `AppServiceProvider` `boot` method.
* Note: You do not need to add anything for the built-in socialite providers unless you override them with your own providers.
```php
Event::listen(function (\SocialiteProviders\Manager\SocialiteWasCalled $event) {
$event->extendSocialite('rikoid', \RikoDEV\Id\Provider::class);
});
```
Laravel 10 or 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](https://socialiteproviders.com/usage/) for detailed instructions.
```php
protected $listen = [
\SocialiteProviders\Manager\SocialiteWasCalled::class => [
// ... other providers
\RikoDEV\Id\RikoExtendSocialite::class.'@handle',
],
];
```
### Usage
You should now be able to use the provider like you would regularly use Socialite (assuming you have the facade installed):
```php
return Socialite::driver('rikoid')->redirect();
```
### Returned User fields
- ``id``
- ``nickname``
- ``name``
- ``email``
- ``avatar``