Download the PHP package jpblu/telegram-error-notifier without Composer
On this page you can find all versions of the php package jpblu/telegram-error-notifier. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download jpblu/telegram-error-notifier
More information about jpblu/telegram-error-notifier
Files in jpblu/telegram-error-notifier
Package telegram-error-notifier
Short Description A PHP library for sending alert messages to a Telegram bot. Compatible with Laravel.
License MIT
Informations about the package telegram-error-notifier
Telegram Error Notifier
A PHP library for sending alert messages to a Telegram bot. Compatible with Laravel.
Installation
You can install the package using Composer:
Telegram Setup
- Create a Telegram bot.
- Get the bot token.
- Create a private or public channel.
- Add your bot as an admin of the channel.
- Get the channel ID (prefix with
@if it's a public channel or use the numeric ID for private ones).
Note: Refer to Telegram Bot documentations for further instructions.
Usage (PHP projects)
Usage (Laravel project)
This library automatically registers a Service Provider and Facade if used in a Laravel project.
Configuration
-
Add environment variables to your
.envfile: - Add to
config/services.php
Examples
Send an error message inside a try/catch block
Notify errors inside a queued Job
Catch all unhandled exceptions in the global Exception Handler
Laravel 11+ / 13.x — edit bootstrap/app.php:
Laravel 8–10 — edit app/Exceptions/Handler.php:
Manual notification
Send a message from console
You can send messages directly from the console using the Artisan command:
Example with dynamic messages:
Returned Values
The send() method returns an array with the response from the Telegram API (or an error if applicable).
Example:
Laravel Compatibility
This package has been tested and works with the following Laravel versions:
- Laravel 8.x
- Laravel 9.x (LTS)
- Laravel 10.x (LTS)
- Laravel 11.x
- Laravel 12.x
- Laravel 13.x
Laravel 5.5+ may also work, as this package uses automatic service provider registration via Composer.
Note: Laravel 13 requires PHP 8.3 or higher.
Acknowledgments
- GuzzleHTTP for client connection
- PHPUnit for testing suite
All versions of telegram-error-notifier with dependencies
guzzlehttp/guzzle Version ^7.0
symfony/console Version ^5.4|^6.0|^7.0|^8.0