message = $message; $this->type = $type; $this->title = $title ?? 'System Notification'; $this->data = [ 'message' => $this->message, 'type' => $this->type, 'title' => $this->title, ]; } /** * Get the channels the event should broadcast on. * * @return array */ public function broadcastOn(): array { return [ new Channel('system-notifications'), ]; } /** * The event's broadcast name. */ public function broadcastAs(): string { return 'message.sent'; } }