teamId = $execution->server?->team_id; } /** * A deleted server has no team to tell, so nothing is broadcast. * * @return array */ public function broadcastOn(): array { if (is_null($this->teamId)) { return []; } return [new PrivateChannel("team.{$this->teamId}")]; } /** * Keep the payload under Reverb's max message size: the cleanup log can be large. * * @return array{executionId: int, serverId: int, status: string} */ public function broadcastWith(): array { return [ 'executionId' => $this->execution->id, 'serverId' => $this->execution->server_id, 'status' => $this->execution->status, ]; } }