larament/laravel-backup-telegram
Composer 安装命令:
composer require larament/laravel-backup-telegram
包简介
Send your Laravel backup files to a Telegram chat or channel.
README 文档
README
Easily send your Laravel application's backup files directly to a Telegram chat or channel after each successful backup. This package integrates with spatie/laravel-backup to automate backup delivery and supports large file splitting for Telegram's file size limits.
Features
- Automatically sends backup files to Telegram after each successful backup.
- Supports sending to both private chats and channels.
- Handles large backup files by splitting them into Telegram-compatible chunks.
- Simple configuration and seamless integration with Laravel's backup events.
Requirements
- PHP 8.2+
- Laravel 10, 11, or 12
- spatie/laravel-backup v9.3+
- A Telegram bot and a chat/channel to receive backups
Installation
Install via Composer:
composer require larament/laravel-backup-telegram
Publish the config file (recommended):
php artisan vendor:publish --tag="backup-telegram-config"
Telegram Setup
- Create a Telegram Bot:
- Talk to @BotFather on Telegram and create a new bot. Copy the API token.
- Add Bot to Your Chat or Channel:
- For a private chat, start a conversation with your bot.
- For a channel, add your bot as an administrator.
- Get the Chat ID:
- Use @userinfobot or getIDs bot to find your chat or channel ID.
Configuration
Update your .env file or the published config/backup-telegram.php:
BACKUP_TELEGRAM_BOT_TOKEN=your_bot_token BACKUP_TELEGRAM_CHAT_ID=your_chat_id BACKUP_TELEGRAM_CHUNK_SIZE=40 # (optional, in MB, default: 40, max: 49)
Or in config/backup-telegram.php:
return [ 'token' => env('BACKUP_TELEGRAM_BOT_TOKEN'), 'chat_id' => env('BACKUP_TELEGRAM_CHAT_ID'), 'chunk_size' => env('BACKUP_TELEGRAM_CHUNK_SIZE', 40), // in megabytes (max 49 MB) ];
How it Works
- On every successful backup (
spatie/laravel-backupevent), the package will automatically send the backup file to your configured Telegram chat/channel. - If the file is larger than the Telegram limit (default 40MB), it will be split and sent in parts.
Usage
No manual usage is required! Once installed and configured, the package listens for backup events and sends the files automatically.
If you want to trigger a backup manually:
php artisan backup:run
Advanced: Handling Large Files
- By default, files larger than 40MB are split into chunks and sent as multiple messages.
- You can adjust the chunk size in your config, but it cannot exceed 49MB due to Telegram's limitations.
Testing
Run the test suite:
composer test
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Contributions are welcome! Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
The MIT License (MIT). Please see License File for more information.
larament/laravel-backup-telegram 适用场景与选型建议
larament/laravel-backup-telegram 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 63 次下载、GitHub Stars 达 6, 最近一次更新时间为 2026 年 02 月 05 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「laravel」 「laravel-backup」 「laravel-backup-telegram」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 larament/laravel-backup-telegram 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 larament/laravel-backup-telegram 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 larament/laravel-backup-telegram 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
A Laravel package to backup your application
Alfabank REST API integration
Monitor Laravel Backups with Healthchecks.
A Laravel package to backup your application
This plugin is built on top of Spatie's Laravel-backup package
Backup manager for Laravel
统计信息
- 总下载量: 63
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 6
- 点击次数: 24
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-02-05