hotrush/laravel-backup-telegram-notifications

Telegram notifications for spatie/laravel-backup

4.0.0 2024-05-02 11:49 UTC

This package is auto-updated.

Last update: 2024-12-02 13:00:21 UTC


README

Extension for spatie/laravel-backup to add telegram notifications.

Installation

composer require hotrush/laravel-backup-telegram-notifications

Configuration

  • Configure telegram
// config/services.php
'telegram-bot-api' => [
    'token' => env('TELEGRAM_BOT_TOKEN', 'YOUR BOT TOKEN HERE')
],
  • Configure backup package
// config/backup.php

use NotificationChannels\Telegram\TelegramChannel;

'notifications' => [

    'notifications' => [
        \Hotrush\SpatieBackup\Notifications\Notifications\BackupHasFailedNotification::class => [TelegramChannel::class],
        \Hotrush\SpatieBackup\Notifications\Notifications\UnhealthyBackupWasFoundNotification::class => [TelegramChannel::class],
        \Hotrush\SpatieBackup\Notifications\Notifications\CleanupHasFailedNotification::class => [TelegramChannel::class],
        \Hotrush\SpatieBackup\Notifications\Notifications\BackupWasSuccessfulNotification::class => [TelegramChannel::class],
        \Hotrush\SpatieBackup\Notifications\Notifications\HealthyBackupWasFoundNotification::class => [TelegramChannel::class],
        \Hotrush\SpatieBackup\Notifications\Notifications\CleanupWasSuccessfulNotification::class => [TelegramChannel::class],
    ],

    'notifiable' => \Hotrush\SpatieBackup\Notifications\Notifiable::class,

    'telegram' => [
        'channel_id' => env('BACKUP_TELEGRAM_CHANNEL'),
    ],

    ...
],