Download the PHP package sindaniel/laravel-telegram-error-reporter without Composer
On this page you can find all versions of the php package sindaniel/laravel-telegram-error-reporter. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download sindaniel/laravel-telegram-error-reporter
More information about sindaniel/laravel-telegram-error-reporter
Files in sindaniel/laravel-telegram-error-reporter
Package laravel-telegram-error-reporter
Short Description Laravel package to report application errors to Telegram
License MIT
Informations about the package laravel-telegram-error-reporter
Laravel Telegram Error Reporter
A Laravel package that automatically reports your application's 500 errors to Telegram.
Installation
Install the package via Composer:
Publish the configuration file:
Configuration
1. Create a Telegram Bot
- Open Telegram and search for
@BotFather
- Send
/newbot
and follow the instructions - Save the token provided by BotFather
2. Get the Chat ID
To get your personal Chat ID:
- Search for
@userinfobot
in Telegram - Send
/start
and you'll get your Chat ID
For a group:
- Add your bot to the group
- Send any message in the group
- Visit:
https://api.telegram.org/bot<YOUR_BOT_TOKEN>/getUpdates
- Look for the
chat.id
in the response
3. Environment Variables
Add these variables to your .env
file:
Usage
Basic Configuration in bootstrap/app.php
Replace your current code with this:
Test the Configuration
You can test if your configuration works correctly:
Advanced Configuration
The configuration file config/telegram-error-reporter.php
contains the following options:
Environment Filters
Rate Limiting
Custom Message Template
Available variables:
{app_name}
- Application name{environment}
- Current environment (production, local, etc.){message}
- Error message{file}
- File where the error occurred{line}
- Line where the error occurred{url}
- URL where the error occurred{ip}
- User's IP address{user_agent}
- Browser's user agent{timestamp}
- Date and time of the error{session_id}
- Session ID
Example Artisan Command for Testing
Create an Artisan command to test the reporter:
Features
- ✅ Automatic 500 error reporting
- ✅ Environment filters (production only, staging, etc.)
- ✅ Rate limiting to prevent spam
- ✅ Customizable message templates
- ✅ Additional context support
- ✅ Safe error handling (doesn't cause additional errors)
- ✅ Automatic escaping of Markdown special characters
- ✅ Configurable timeouts for HTTP requests
License
MIT License
Contributing
Contributions are welcome. Please open an issue or pull request.
Changelog
1.0.0
- Initial release
- Basic error reporting to Telegram
- Configuration via config file and environment variables
All versions of laravel-telegram-error-reporter with dependencies
laravel/framework Version ^10.0|^11.0|^12.0
guzzlehttp/guzzle Version ^7.0