*/ public function broadcastOn(): array { return [new PrivateChannel("gomoku.{$this->game->id}")]; } /** * 广播事件名(前端监听 .gomoku.moved)。 */ public function broadcastAs(): string { return 'gomoku.moved'; } /** * 广播数据。 * * @return array */ public function broadcastWith(): array { return [ 'game_id' => $this->game->id, 'row' => $this->row, 'col' => $this->col, 'color' => $this->color, 'current_turn' => $this->game->current_turn, 'board' => $this->game->board, ]; } }