Skip to content

Commit

Permalink
Adds a reference to the $model->broadcastChannel()
Browse files Browse the repository at this point in the history
  • Loading branch information
tonysm committed Jun 13, 2021
1 parent 84f01fb commit 51d5e75
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions broadcasting.md
Original file line number Diff line number Diff line change
Expand Up @@ -844,6 +844,14 @@ If you plan to explicitly return a channel instance from your model's `broadcast
return [new Channel($this->user)];
```

If you need access to the channel name of a model, you may use the `broadcastChannel()` method from any model instance:

```php
$user->broadcastChannel()
```

This method returns the string `App.Models.User.1` for a `App\Models\User` model with an `id` of `1`.

<a name="model-broadcasting-event-conventions"></a>
#### Event Conventions

Expand Down

0 comments on commit 51d5e75

Please sign in to comment.