Skip to content

Commit

Permalink
GITBOOK-25: change request with no subject merged in GitBook
Browse files Browse the repository at this point in the history
  • Loading branch information
joelbutcher authored and gitbook-bot committed Dec 31, 2024
1 parent b8fa742 commit 45920e1
Showing 1 changed file with 56 additions and 13 deletions.
69 changes: 56 additions & 13 deletions guides/socialite-providers.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,9 @@ Icon location: `resources/js/Components/SocialstreamIcons/`

### Socialstream Providers

Inside your applications `socialstream.php` config file, you will want to add the string representation of the SocialiteProvider you are adding support for. For example, if you are adding Sign in With Apple support, you would add the string `'apple'` to the `providers` array:

```
// ./config/socialstream.php
Inside your applications `socialstream.php` config file, you will want to add the string representation of the SocialiteProvider you are adding support for. For example, if you are adding Sign in With Apple support, you would add the string `'apple'` to the `providers` array in `config/socialstream.php`

```php
'providers' => [
\JoelButcher\Socialstream\Providers::github(),
\JoelButcher\Socialstream\Providers::google(),
Expand All @@ -66,23 +64,68 @@ Inside your applications `socialstream.php` config file, you will want to add th
],
```

### Service Providers
### Service Provider

#### Laravel 11+

When using Socialstream alongside Socialite Providers, you will need **both** service providers adding your the `providers` array in you application's `app.php` config file:
In `bootstrap/providers.php`.

```php
'providers' => [
// ...
\App\Providers\SocialstreamServiceProvider::class, // keep
// ...
return [
// a whole bunch of providers
// remove 'Laravel\Socialite\SocialiteServiceProvider',
\SocialiteProviders\Manager\ServiceProvider::class, // add
];
```

// ...
// remove 'Laravel\Socialite\SocialiteServiceProvider::class',
#### In Laravel 10 or Below

In `config\app.php`.

```php
'providers' => [
// a whole bunch of providers
// remove 'Laravel\Socialite\SocialiteServiceProvider',
\SocialiteProviders\Manager\ServiceProvider::class, // add
// ...
];
```

### 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('microsoft', \SocialiteProviders\Microsoft\Provider::class);
});
```

<details>

<summary>Laravel 10 or below</summary>

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
\SocialiteProviders\Microsoft\MicrosoftExtendSocialite::class.'@handle',
],
];
```

\


</details>

### Database Changes – `token`

{% hint style="danger" %}
Expand Down

0 comments on commit 45920e1

Please sign in to comment.