notificationPref('notif_new_reply')) $ch[] = 'database'; if ($notifiable->notificationPref('email_new_reply')) $ch[] = 'mail'; return $ch; } public function toArray(object $notifiable): array { return [ 'type' => 'new_reply', 'video_id' => $this->video->id, 'video_route_key' => $this->video->getRouteKey(), 'video_title' => $this->video->title, 'video_thumbnail' => $this->video->thumbnail, 'actor_id' => $this->replier->id, 'actor_name' => $this->replier->name, 'actor_avatar' => $this->replier->avatar_url, 'comment_preview' => Str::limit($this->reply->body, 80), ]; } public function toMail(object $notifiable): MailMessage { return (new MailMessage) ->subject($this->replier->name . ' replied to your comment') ->view('emails.new-reply', [ 'video' => $this->video, 'reply' => $this->reply, 'replier' => $this->replier, 'recipient'=> $notifiable, ]); } }