name = $database->name; $this->frequency = $backup->frequency; } public function via(object $notifiable): array { return setNotificationChannels($notifiable, 'database_backups'); } public function toMail(): MailMessage { $mail = new MailMessage(); $mail->subject("Last Hour: Backup successfully done for {$this->database->name}"); $mail->view('emails.backup-success', [ 'name' => $this->name, 'frequency' => $this->frequency, ]); return $mail; } public function toDiscord(): string { return "Last Hour: Database backup for {$this->name} with frequency of {$this->frequency} was successful."; } public function toTelegram(): array { $message = "Last Hour: Database backup for {$this->name} with frequency of {$this->frequency} was successful."; return [ "message" => $message, ]; } }