trait BroadcastsEvents (View source)

Methods

static void
bootBroadcastsEvents()

Boot the event broadcasting trait.

broadcastCreated(Channel|HasBroadcastChannel|array|null $channels = null)

Broadcast that the model was created.

broadcastUpdated(Channel|HasBroadcastChannel|array|null $channels = null)

Broadcast that the model was updated.

broadcastTrashed(Channel|HasBroadcastChannel|array|null $channels = null)

Broadcast that the model was trashed.

broadcastRestored(Channel|HasBroadcastChannel|array|null $channels = null)

Broadcast that the model was restored.

broadcastDeleted(Channel|HasBroadcastChannel|array|null $channels = null)

Broadcast that the model was deleted.

broadcastIfBroadcastChannelsExistForEvent(mixed $instance, string $event, mixed $channels = null)

Broadcast the given event instance if channels are configured for the model event.

mixed
newBroadcastableModelEvent(string $event)

Create a new broadcastable model event event.

newBroadcastableEvent(string $event)

Create a new broadcastable model event for the model.

Channel|array
broadcastOn(string $event)

Get the channels that model events should broadcast on.

string|null
broadcastConnection()

Get the queue connection that should be used to broadcast model events.

string|null
broadcastQueue()

Get the queue that should be used to broadcast model events.

bool
broadcastAfterCommit()

Determine if the model event broadcast queued job should be dispatched after all transactions are committed.

Details

static void bootBroadcastsEvents()

Boot the event broadcasting trait.

Return Value

void

PendingBroadcast broadcastCreated(Channel|HasBroadcastChannel|array|null $channels = null)

Broadcast that the model was created.

Parameters

Channel|HasBroadcastChannel|array|null $channels

Return Value

PendingBroadcast

PendingBroadcast broadcastUpdated(Channel|HasBroadcastChannel|array|null $channels = null)

Broadcast that the model was updated.

Parameters

Channel|HasBroadcastChannel|array|null $channels

Return Value

PendingBroadcast

PendingBroadcast broadcastTrashed(Channel|HasBroadcastChannel|array|null $channels = null)

Broadcast that the model was trashed.

Parameters

Channel|HasBroadcastChannel|array|null $channels

Return Value

PendingBroadcast

PendingBroadcast broadcastRestored(Channel|HasBroadcastChannel|array|null $channels = null)

Broadcast that the model was restored.

Parameters

Channel|HasBroadcastChannel|array|null $channels

Return Value

PendingBroadcast

PendingBroadcast broadcastDeleted(Channel|HasBroadcastChannel|array|null $channels = null)

Broadcast that the model was deleted.

Parameters

Channel|HasBroadcastChannel|array|null $channels

Return Value

PendingBroadcast

protected PendingBroadcast|null broadcastIfBroadcastChannelsExistForEvent(mixed $instance, string $event, mixed $channels = null)

Broadcast the given event instance if channels are configured for the model event.

Parameters

mixed $instance
string $event
mixed $channels

Return Value

PendingBroadcast|null

mixed newBroadcastableModelEvent(string $event)

Create a new broadcastable model event event.

Parameters

string $event

Return Value

mixed

protected BroadcastableModelEventOccurred newBroadcastableEvent(string $event)

Create a new broadcastable model event for the model.

Parameters

string $event

Return Value

BroadcastableModelEventOccurred

Channel|array broadcastOn(string $event)

Get the channels that model events should broadcast on.

Parameters

string $event

Return Value

Channel|array

string|null broadcastConnection()

Get the queue connection that should be used to broadcast model events.

Return Value

string|null

string|null broadcastQueue()

Get the queue that should be used to broadcast model events.

Return Value

string|null

bool broadcastAfterCommit()

Determine if the model event broadcast queued job should be dispatched after all transactions are committed.

Return Value

bool