*/ public function via(object $notifiable): array { return ['database', 'mail']; } /** * @return array */ public function toDatabase(object $notifiable): array { return [ 'workspace_id' => $this->declaration->workspace_id, 'notification_type' => NotificationType::Mention, 'declaration_id' => $this->declaration->id, 'declaration_title' => $this->declaration->title, 'mentioned_by_id' => $this->mentionedBy->id, 'mentioned_by_name' => $this->mentionedBy->name, 'message' => $this->message, 'url' => route('declarations.show', $this->declaration), ]; } public function toMail(object $notifiable): MailMessage { return (new MailMessage) ->subject('Vous avez été mentionné - '.$this->declaration->title) ->markdown('emails.declaration-mention', [ 'declarationTitle' => $this->declaration->title, 'mentionedByName' => $this->mentionedBy->name, 'message' => $this->message, 'url' => route('declarations.show', $this->declaration), ]); } }