AnonymousEvent
class AnonymousEvent implements ShouldBroadcast (View source)
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 | $connection | The connection the event should be broadcast on. |
|
protected | $name | The name the event should be broadcast as. |
|
protected | $payload | The payload the event should be broadcast with. |
|
protected | $includeCurrentUser | Should the broadcast include the current user. |
|
protected | $shouldBroadcastNow | Indicates if the event should be broadcast synchronously. |
Methods
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 using a specific broadcaster.
Get the broadcaster connections the event should be broadcast on.
Exclude the current user from receiving the broadcast.
Create a new anonymous broadcastable event instance.
Set the connection the event should be broadcast on.
Set the name the event should be broadcast as.
Set the payload the event should be broadcast with.
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
static mixed
dispatch()
Dispatch the event with the given arguments.
static mixed
dispatchIf(bool $boolean, mixed ...$arguments)
Dispatch the event with the given arguments if the given truth test passes.
static mixed
dispatchUnless(bool $boolean, mixed ...$arguments)
Dispatch the event with the given arguments unless the given truth test passes.
static PendingBroadcast
broadcast()
Broadcast the event with the given arguments.
$this
broadcastVia(array|string|null $connection = null)
Broadcast the event using a specific broadcaster.
array
broadcastConnections()
Get the broadcaster connections the event should be broadcast on.
$this
dontBroadcastToCurrentUser()
Exclude the current user from receiving the broadcast.
$this
broadcastToEveryone()
Broadcast the event to everyone.
void
__construct(Channel|array|string $channels)
Create a new anonymous broadcastable event instance.
AnonymousEvent
via(string $connection)
Set the connection the event should be broadcast on.
AnonymousEvent
as(string $name)
Set the name the event should be broadcast as.
AnonymousEvent
with(Arrayable|array $payload)
Set the payload the event should be broadcast with.
AnonymousEvent
toOthers()
Broadcast the event to everyone except the current user.
void
sendNow()
Broadcast the event.
void
send()
Broadcast the event.
string
broadcastAs()
Get the name the event should broadcast as.
array
broadcastWith()
Get the payload the event should broadcast with.
bool
shouldBroadcastNow()
Determine if the event should be broadcast synchronously.