Skip to content

Commit

Permalink
fix: add laravel 11 docs all providers (#1187)
Browse files Browse the repository at this point in the history
  • Loading branch information
atymic authored Apr 1, 2024
1 parent 92c6f24 commit 54bb89e
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,21 @@ Please see the [Base Installation Guide](https://socialiteproviders.com/usage/),

### 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.
Expand All @@ -32,6 +47,7 @@ protected $listen = [
],
];
```
</details>

### Usage

Expand Down

0 comments on commit 54bb89e

Please sign in to comment.