*/ public function via(object $notifiable): array { return ['database', 'mail']; } /** * @return array */ public function toDatabase(object $notifiable): array { return [ 'workspace_id' => $this->declaration->workspace_id, 'declaration_id' => $this->declaration->id, 'notification_type' => NotificationType::DeclarationOverdue, ]; } public function toMail(object $notifiable): MailMessage { return (new MailMessage) ->subject('Déclaration en retard - '.($this->declaration->title ?? 'Sans titre')) ->markdown('emails.declaration-overdue', [ 'declarationTitle' => $this->declaration->title ?? 'Sans titre', 'dueDate' => $this->declaration->due_date?->format('d/m/Y'), 'url' => route('declarations.show', $this->declaration), 'firmName' => $this->declaration->workspace?->name, ]); } }