*/ public function broadcastOn(): array { return [new PresenceChannel('room.1')]; } /** * 广播事件名(前端监听 .baccarat.settled)。 */ public function broadcastAs(): string { return 'baccarat.settled'; } /** * 广播数据:骰子点数 + 开奖结果 + 统计。 * * @return array */ public function broadcastWith(): array { return [ 'round_id' => $this->round->id, 'dice' => [$this->round->dice1, $this->round->dice2, $this->round->dice3], 'total_points' => $this->round->total_points, 'result' => $this->round->result, 'result_label' => $this->round->resultLabel(), 'total_payout' => $this->round->total_payout, 'bet_count' => $this->round->bet_count, ]; } }