nhamtphat/laravel-backup-telegram-notifications
最新稳定版本:1.0.0
Composer 安装命令:
composer require nhamtphat/laravel-backup-telegram-notifications
包简介
Telegram notifications for spatie/laravel-backup
README 文档
README
A wrapper for spatie/laravel-backup to send beautified Telegram notifications. This package is a fork of hotrush/laravel-backup-telegram-notifications.
✨ Features
- Beautified Notifications: Rich HTML-formatted Telegram messages with emojis and clear structure.
- Easy Integration: Seamlessly works with the existing Spatie Backup notification system.
- Customizable: Uses Blade views for notification templates, allowing for easy customization.
🚀 Installation
You can install the package via composer:
composer require nhamtphat/laravel-backup-telegram-notifications
⚙️ Configuration
1. Configure Telegram Bot
Add your Telegram Bot Token to your config/services.php file:
// config/services.php 'telegram-bot-api' => [ 'token' => env('TELEGRAM_BOT_TOKEN'), ],
2. Configure Backup Notifications
In your config/backup.php file, update the notifications section to use the Telegram channel and this package's notification classes.
// config/backup.php use NotificationChannels\Telegram\TelegramChannel; use NhamtPhat\SpatieBackup\Notifications\Notifiable; use NhamtPhat\SpatieBackup\Notifications\Notifications\BackupHasFailedNotification; use NhamtPhat\SpatieBackup\Notifications\Notifications\BackupWasSuccessfulNotification; use NhamtPhat\SpatieBackup\Notifications\Notifications\CleanupHasFailedNotification; use NhamtPhat\SpatieBackup\Notifications\Notifications\CleanupWasSuccessfulNotification; use NhamtPhat\SpatieBackup\Notifications\Notifications\HealthyBackupWasFoundNotification; use NhamtPhat\SpatieBackup\Notifications\Notifications\UnhealthyBackupWasFoundNotification; 'notifications' => [ 'notifications' => [ BackupHasFailedNotification::class => [TelegramChannel::class], UnhealthyBackupWasFoundNotification::class => [TelegramChannel::class], CleanupHasFailedNotification::class => [TelegramChannel::class], BackupWasSuccessfulNotification::class => [TelegramChannel::class], HealthyBackupWasFoundNotification::class => [TelegramChannel::class], CleanupWasSuccessfulNotification::class => [TelegramChannel::class], ], 'notifiable' => Notifiable::class, 'telegram' => [ 'channel_id' => env('TELEGRAM_CHAT_ID'), ], ],
Don't forget to add TELEGRAM_BOT_TOKEN and TELEGRAM_CHAT_ID to your .env file.
🛠 Usage
Once configured, notifications will be sent automatically by the spatie/laravel-backup package whenever a backup event occurs.
📄 License
The MIT License (MIT). Please see License File for more information.
统计信息
- 总下载量: 22
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 5
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-02-13