hotrush / laravel-backup-telegram-notifications
Telegram notifications for spatie/laravel-backup
Installs: 12 334
Dependents: 0
Suggesters: 0
Security: 0
Stars: 6
Watchers: 3
Forks: 5
Open Issues: 1
Requires
- php: >=8.2
- laravel-notification-channels/telegram: ^5.0
- spatie/laravel-backup: ^8.0
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'),
],
...
],