message = $message; $this->link = $link ?? '#'; $this->title = $title ?? __('New Notification'); } public function via(object $notifiable): array { return ['broadcast', 'database']; } public function toArray(object $notifiable): array { return [ 'user_id' => $notifiable->id, 'user_name' => $notifiable->name, 'data' => [ 'message' => $this->message, 'link' => $this->link, 'title' => $this->title, ], ]; } }