*/ public function via(mixed $notifiable): array { return CommentsConfig::getNotificationChannels(); } /** @return array */ public function toDatabase(mixed $notifiable): array { return [ 'comment_id' => $this->comment->id, 'commentable_type' => $this->comment->commentable_type, 'commentable_id' => $this->comment->commentable_id, 'mentioner_name' => $this->mentionedBy->getCommentDisplayName(), 'body' => Str::limit(strip_tags($this->comment->body), 100), ]; } public function toMail(mixed $notifiable): MailMessage { $mentionerName = $this->mentionedBy->getCommentDisplayName(); return (new MailMessage) ->subject('You were mentioned in a comment') ->line("{$mentionerName} mentioned you in a comment:") ->line(Str::limit(strip_tags($this->comment->body), 200)); } }