*/ public function broadcastOn(): array { return [ new PresenceChannel('room.'.$this->roomId), ]; } /** * 广播数据 * * @return array */ public function broadcastWith(): array { return [ 'from_user' => $this->fromUser, 'target_user' => $this->targetUser, 'display_text' => $this->displayText, 'from_user_headface' => $this->fromUserHeadface, ]; } }