Skip to content

Commit

Permalink
Merge pull request #51 from JamieBradders/develop
Browse files Browse the repository at this point in the history
Documentation Update for Laravel 11
  • Loading branch information
jimmypuckett authored Apr 14, 2024
2 parents afba03c + 1aba8d9 commit 963cd66
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,25 @@ When a Laravel `User` logs out, to log out their Discourse session Simply add th
];
```

### Laravel 11

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).

Therefore, the implementation is slightly different, and it should be registered within the `boot` method of the `AppServiceProvider` as per the example below.

```php
/**
* Bootstrap any application services.
*/
public function boot(): void
{
Event::listen(
\Illuminate\Auth\Events\Logout::class,
\Spinen\Discourse\Listeners\LogoutDiscourseUser::class
);
}
```

## Left to do

* badges for user
Expand Down

0 comments on commit 963cd66

Please sign in to comment.