details = $details; $this->link = $link; } /** * Get the notification's delivery channels. * * @param mixed $notifiable * @return array */ public function via($notifiable) { return ['database', 'broadcast']; } public function toDatabase($notifiable) { return [ 'details' => $this->details, 'link' => $this->link ]; } /** * Get the array representation of the notification. * * @param mixed $notifiable * @return array */ public function toArray($notifiable) { return [ 'details' => $this->details, 'link' => $this->link ]; } public function toBroadcast($notifiable) { return new BroadcastMessage([ 'details' => $this->details, 'link' => $this->link ]); } }