Skip to content

Commit 963cd66

Browse files
authored
Merge pull request #51 from JamieBradders/develop
Documentation Update for Laravel 11
2 parents afba03c + 1aba8d9 commit 963cd66

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

readme.md

+19
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,25 @@ When a Laravel `User` logs out, to log out their Discourse session Simply add th
192192
];
193193
```
194194

195+
### Laravel 11
196+
197+
In Laravel 11, the use of the `EventServiceProvider` is discouraged and events [should be registered in the `AppServiceProvider`](https://laravel.com/docs/11.x/events#manually-registering-events).
198+
199+
Therefore, the implementation is slightly different, and it should be registered within the `boot` method of the `AppServiceProvider` as per the example below.
200+
201+
```php
202+
/**
203+
* Bootstrap any application services.
204+
*/
205+
public function boot(): void
206+
{
207+
Event::listen(
208+
\Illuminate\Auth\Events\Logout::class,
209+
\Spinen\Discourse\Listeners\LogoutDiscourseUser::class
210+
);
211+
}
212+
```
213+
195214
## Left to do
196215

197216
* badges for user

0 commit comments

Comments
 (0)