leko-team/telegram-errors-notifications

A package for handling and notifying errors via Telegram

dev-main 2025-03-10 10:09 UTC

This package is auto-updated.

Last update: 2025-03-10 10:10:59 UTC


README

Description

A PHP package for handling and notifying errors via Telegram. This package helps developers receive real-time error notifications in a Telegram chat, making debugging and monitoring more efficient.

Installation

To install the package, run the following command:

composer require leko-team/telegram-errors-notifications

Configuration

Add the following line to your Handler file to extend its functionality:

use LekoTeam\TelegramErrorsNotifications\Exceptions\Handler as ExceptionHandler;

Configure your Telegram Bot API token and chat ID in your environment variables or configuration file:

TELEGRAM_BOT_TOKEN=your-bot-token-here TELEGRAM_CHAT_ID=your-chat-id-here

Usage

To start receiving error notifications via Telegram, follow these steps:

  1. Ensure the package is properly installed and configured.

  2. Use the custom ExceptionHandler in your Laravel or PHP application.

  3. When an error occurs, the package will automatically send a notification to the specified Telegram chat.

Testing

To test the package, you can trigger an error manually:

throw new Exception("Test Telegram Error Notification");

Check your Telegram chat to see if the notification arrives correctly.

Credits

Developed and maintained by Leko Team. Special thanks to contributors and testers who helped improve the package.

License

The MIT License (MIT). Please see License File for more information.