roomId), ]; } /** * 方法功能:声明广播数据。 */ public function broadcastWith(): array { $quizTypeLabel = \App\Models\Riddle::labelForType($this->quizType); return [ 'round_id' => $this->roundId, 'quiz_type' => $this->quizType, 'quiz_type_label' => $quizTypeLabel, 'quiz_round_id' => $this->roundId, 'quiz_answer' => $this->answer, 'quiz_reward_gold' => $this->rewardGold, 'quiz_reward_exp' => $this->rewardExp, 'quiz_round_ended_id' => $this->roundId, 'answer' => $this->answer, 'winner_username' => $this->winnerUsername, 'reward_gold' => $this->rewardGold, 'reward_exp' => $this->rewardExp, ]; } }