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

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.

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.

via(string $connection)

Set the connection the event should be broadcast on.

as(string $name)

Set the name the event should be broadcast as.

with(Arrayable|array $payload)

Set the payload the event should be broadcast with.

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.

Channel|Channel[]|string[]|string
broadcastOn()

Get the channels the event should broadcast on.

bool
shouldBroadcastNow()

Determine if the event should be broadcast synchronously.

Details

static mixed dispatch()

Dispatch the event with the given arguments.

Return Value

mixed

static mixed dispatchIf(bool $boolean, mixed ...$arguments)

Dispatch the event with the given arguments if the given truth test passes.

Parameters

bool $boolean
mixed ...$arguments

Return Value

mixed

static mixed dispatchUnless(bool $boolean, mixed ...$arguments)

Dispatch the event with the given arguments unless the given truth test passes.

Parameters

bool $boolean
mixed ...$arguments

Return Value

mixed

static PendingBroadcast broadcast()

Broadcast the event with the given arguments.

Return Value

PendingBroadcast

$this broadcastVia(array|string|null $connection = null)

Broadcast the event using a specific broadcaster.

Parameters

array|string|null $connection

Return Value

$this

array broadcastConnections()

Get the broadcaster connections the event should be broadcast on.

Return Value

array

$this dontBroadcastToCurrentUser()

Exclude the current user from receiving the broadcast.

Return Value

$this

$this broadcastToEveryone()

Broadcast the event to everyone.

Return Value

$this

void __construct(Channel|array|string $channels)

Create a new anonymous broadcastable event instance.

Parameters

Channel|array|string $channels

Return Value

void

AnonymousEvent via(string $connection)

Set the connection the event should be broadcast on.

Parameters

string $connection

Return Value

AnonymousEvent

AnonymousEvent as(string $name)

Set the name the event should be broadcast as.

Parameters

string $name

Return Value

AnonymousEvent

AnonymousEvent with(Arrayable|array $payload)

Set the payload the event should be broadcast with.

Parameters

Arrayable|array $payload

Return Value

AnonymousEvent

AnonymousEvent toOthers()

Broadcast the event to everyone except the current user.

Return Value

AnonymousEvent

void sendNow()

Broadcast the event.

Return Value

void

void send()

Broadcast the event.

Return Value

void

string broadcastAs()

Get the name the event should broadcast as.

Return Value

string

array broadcastWith()

Get the payload the event should broadcast with.

Return Value

array

Channel|Channel[]|string[]|string broadcastOn()

Get the channels the event should broadcast on.

Return Value

Channel|Channel[]|string[]|string

bool shouldBroadcastNow()

Determine if the event should be broadcast synchronously.

Return Value

bool