type = $type; $this->actor = $actor; $this->object = $object; $this->activity = $activity; } /** * Get the notification's delivery channels. * * @return array */ public function via(object $notifiable): array { return ['database', 'broadcast']; } /** * Get the array representation of the notification. * * @return array */ public function toArray(object $notifiable): array { return [ 'type' => $this->type, 'actor' => $this->actor, 'object' => $this->object, 'activity' => $this->activity, ]; } public function toBroadcast ($notifiable) { // we don't really need to broadcast any information return [ "notification_type" => $this->type, "actor" => $this->actor, "object" => $this->object, "activity" => $this->activity, ]; } }