klytron / laravel-schedule-telegram-output
Laravel package to send scheduled command outputs through Telegram bots
                                    Fund package maintenance!
                                                                            
                                                                                                                                        www.klytron.com/buy-me-a-coffee
                                                                                    
                                                                
Installs: 6
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
pkg:composer/klytron/laravel-schedule-telegram-output
Requires
- php: ^8.2
 - illuminate/console: ^10.0|^11.0|^12.0
 - illuminate/support: ^10.0|^11.0|^12.0
 
Requires (Dev)
- orchestra/testbench: ^8.0|^9.0|^10.0
 - phpunit/phpunit: ^10.0|^11.0
 
README
A Laravel package to send scheduled job outputs to Telegram with robust formatting and flexible configuration.
🚀 Quick Start
- 
Install:
composer require klytron/laravel-schedule-telegram-output
 - 
Publish config (optional):
php artisan vendor:publish --provider="Klytron\LaravelScheduleTelegramOutput\ScheduleTelegramOutputServiceProvider" --tag=schedule-telegram-output-config - 
Configure your
.env:TELEGRAM_BOT_TOKEN=your-telegram-bot-token TELEGRAM_DEFAULT_CHAT_ID=your-chat-id SCHEDULE_TELEGRAM_OUTPUT_DEBUG=true # or false SCHEDULE_TELEGRAM_OUTPUT_PARSE_MODE=MarkdownV2 # or HTML
See Telegram Setup Guide for details.
Notes:
SCHEDULE_TELEGRAM_OUTPUT_PARSE_MODEis read byconfig/schedule-telegram-output.php.- By default only a snippet of output is sent (first 10 lines, up to 500 chars). Configure via 
message_format.snippet_max_length. 
 - 
Basic usage (macro-first):
$schedule->command('your:command')->sendOutputToTelegram();
Or specify a chat ID:
$schedule->command('your:command')->sendOutputToTelegram('123456789');
 
⚙️ Configuration
- All options are in 
config/schedule-telegram-output.php. - By default, only a snippet of the output (first 10 lines or up to 500 characters) is sent to Telegram.
 - You can override the snippet length and other options in your config.
 - See the Configuration Reference for all options and details.
 
Advanced (optional)
- The package includes advanced classes (
TelegramEvent,TelegramSchedule,TelegramScheduleTrait) for special cases. - The recommended approach is using the macro on 
Illuminate\Console\Scheduling\Eventas shown above. 
📖 Documentation & Guides
- Getting Started Guide
 - Telegram Setup Guide
 - Configuration Reference
 - Advanced Usage
 - Examples
 - Troubleshooting & FAQ
 
🧑💻 Advanced & Examples
- See Examples and Advanced Usage for trait-based, multi-bot, and conditional scenarios.
 
❓ Having issues?
- See Troubleshooting & FAQ
 - Or open an issue on GitHub
 
License
MIT