AnonymousEvent
class AnonymousEvent implements ShouldBroadcast
Traits
Properties
| protected array | $broadcastConnection | The broadcaster connection to use to broadcast the event. |
from InteractsWithBroadcasting |
| string|null | $socket | The socket ID for the user that raised the event. |
from InteractsWithSockets |
| protected string|null | $connection | The connection the event should be broadcast on. |
|
| protected string|null | $name | The name the event should be broadcast as. |
|
| protected array | $payload | The payload the event should be broadcast with. |
|
| protected bool | $includeCurrentUser | Should the broadcast include the current user. |
|
| protected bool | $shouldBroadcastNow | Indicates if the event should be broadcast synchronously. |
Methods
Dispatch the event with the given arguments.
Dispatch the event with the given arguments if the given truth test passes.
Dispatch the event with the given arguments unless the given truth test passes.
Broadcast the event with the given arguments.
Broadcast the event using a specific broadcaster.
Get the broadcaster connections the event should be broadcast on.
Exclude the current user from receiving the broadcast.
Broadcast the event to everyone.
Set the connection the event should be broadcast on.
Set the name the event should be broadcast as.
Broadcast the event to everyone except the current user.
Broadcast the event.
Broadcast the event.
Get the name the event should broadcast as.
Get the payload the event should broadcast with.
Get the channels the event should broadcast on.
Determine if the event should be broadcast synchronously.
Details
in
Dispatchable at line 14
static mixed
dispatch(mixed ...$arguments)
Dispatch the event with the given arguments.
in
Dispatchable at line 22
static mixed
dispatchIf(bool $boolean, mixed ...$arguments)
Dispatch the event with the given arguments if the given truth test passes.
in
Dispatchable at line 30
static mixed
dispatchUnless(bool $boolean, mixed ...$arguments)
Dispatch the event with the given arguments unless the given truth test passes.
in
Dispatchable at line 38
static PendingBroadcast
broadcast(mixed ...$arguments)
Broadcast the event with the given arguments.
in
InteractsWithBroadcasting at line 22
InteractsWithBroadcasting
broadcastVia(UnitEnum|array|string|null $connection = null)
Broadcast the event using a specific broadcaster.
in
InteractsWithBroadcasting at line 37
array
broadcastConnections()
Get the broadcaster connections the event should be broadcast on.
in
InteractsWithSockets at line 19
InteractsWithSockets
dontBroadcastToCurrentUser()
Exclude the current user from receiving the broadcast.
in
InteractsWithSockets at line 29
InteractsWithSockets
broadcastToEveryone()
Broadcast the event to everyone.
at line 46
__construct(array|Channel|string $channels)
Create a new anonymous broadcastable event instance.
at line 54
AnonymousEvent
via(string $connection)
Set the connection the event should be broadcast on.
at line 64
AnonymousEvent
as(string $name)
Set the name the event should be broadcast as.
at line 74
AnonymousEvent
with(array|Arrayable $payload)
Set the payload the event should be broadcast with.
at line 88
AnonymousEvent
toOthers()
Broadcast the event to everyone except the current user.
at line 98
void
sendNow()
Broadcast the event.
at line 108
void
send()
Broadcast the event.
at line 120
string
broadcastAs()
Get the name the event should broadcast as.
at line 132
array
broadcastWith()
Get the payload the event should broadcast with.
at line 140
array|Channel
broadcastOn()
Get the channels the event should broadcast on.
at line 148
bool
shouldBroadcastNow()
Determine if the event should be broadcast synchronously.