userId = $user_id; $this->scene = $scene; $this->number = $number; } /** * 取事件参数 * * @return array */ public function getEventParam() : array { $param = [ 'user_id' => $this->userId, 'scene' => $this->scene, 'number' => $this->number, ]; return $param; } /** * Get the channels the event should broadcast on. * * @return \Illuminate\Broadcasting\Channel|array */ public function broadcastOn() { return new PrivateChannel('channel-name'); } }