sindaniel / laravel-telegram-error-reporter
A Laravel package to report errors to Telegram
dev-main
2025-06-16 22:15 UTC
Requires
- php: ^8.0
- guzzlehttp/guzzle: ^7.0
- laravel/framework: ^9.0|^10.0|^12.0
This package is auto-updated.
Last update: 2025-06-16 22:15:48 UTC
README
A Laravel package that automatically reports errors to Telegram using a bot.
Installation
- Install the package via Composer:
composer require daniel/laravel-telegram-error-reporter
- Publish the configuration file:
php artisan vendor:publish --provider="Daniel\TelegramErrorReporter\TelegramErrorReporterServiceProvider" --tag="config"
- Add the following environment variables to your
.env
file:
TELEGRAM_ERROR_BOT_TOKEN=your_bot_token_here
TELEGRAM_ERROR_CHAT_ID=your_chat_id_here
Configuration
- Create a new Telegram bot using @BotFather and get your bot token
- Get your chat ID by:
- Adding your bot to a group
- Sending a message in the group
- Accessing:
https://api.telegram.org/bot<YourBOTToken>/getUpdates
- Look for the "chat" object and copy the "id" value
Usage
The package will automatically report all errors to your configured Telegram chat. No additional code is required.
Features
- Reports error messages, file, line number
- Includes request URL, IP address, and user agent
- Timestamps and session IDs for tracking
- Formatted messages with emojis for better readability
- Markdown support for better formatting
License
The MIT License (MIT). Please see License File for more information.