You are viewing the documentation for an older version of this package. You can check the version you are using with the following command:
composer show spatie/laravel-backup-server
Adding extra notification channels
By default the package send notifications via email or Slack. You can add an extra notification channels such as Telegram or native mobile push notification, etc.
Let say you want to be notified via Pusher push notifications when a backup fails. To make this happen you'll need to create your own BackupFailed notification class like the one below:
namespaceApp\Notifications;
useSpatie\BackupServer\Notifications\Notifications\BackupFailedNotificationasBaseNotification;
useNotificationChannels\PusherPushNotifications\Message;
classBackupFailedNotificationextendsBaseNotification
{
publicfunctiontoPushNotification($notifiable)
{
returnMessage::create()
->iOS()
->badge(1)
->sound('fail')
->body("The backup of {$this->sourceName()} has failed");
}
}
##3. Register your custom notification in the config file
The last thing you need to do is register your custom notification in the config file.