usmonaliyev/laravel-telegram-notifier
| Install | |
|---|---|
composer require usmonaliyev/laravel-telegram-notifier |
|
| Latest Version: | v1.4.1 |
| PHP: | ^7.4|^8.1 |
| Laravel: | 10 · 11 · 12 |
| License: | MIT |
| Last Updated: | Mar 17, 2025 |
| Links: | GitHub · Packagist |
laravel-telegram-notifier
This package send bugs and messages to your telegram group or chat.
Screenshots
Installation
Install this project with composer
composer require usmonaliyev/laravel-telegram-notifier
To control it, create config file
php artisan vendor:publish --provider="Usmonaliyev\LaravelTelegramNotifier\LaravelTelegramNotifierServiceProvider"
Add your bot token and receiver chat id to .env file.
TELEGRAM_NOTIFIER_BOT_TOKEN=
CHAT_ID=
TELEGRAM_NOTIFIER_RESPONSIBLE=@someone
I recommend that you only use it on production.
To do this, change the value of TELEGRAM_NOTIFIER_ENABLED in .env to production.
TELEGRAM_NOTIFIER_ENABLED=false
Custom usage
If you want to send custom message, there is notify function:
<?php
use Usmonaliyev\LaravelTelegramNotifier\Facades\TelegramNotifier;
TelegramNotifier::notify("There is your text")
Also, there is error function to send handled error:
<?php
use Usmonaliyev\LaravelTelegramNotifier\Facades\TelegramNotifier;
try {
...
} catch (Exception $exception) {
TelegramNotifier::error($exception);
}
Configuration
There are laravel-telegram-notifier.php in your config folder.
If you want to send bag to two or three chat ids you add chat id to chat_ids array of laravel-telegram-notifier.php file.
"chat_ids" => [env("CHAT_ONE_ID"), env("CHAT_TWO_ID"), env("CHAT_THREE_ID")],
Running Tests
To verify that the package is fully installed and working. You can run the command below which will help you create a new dummy error.
php artisan notify:check
In production mode you can load configurations from .env with php artisan config:clear command.
Related Packages
Monitor exception and report to the notification channels(Log、Mail、AnPush、Bar...
Email and Slack notifications for uncaught exceptions in a Laravel application,...
Extended laravel debug exceptions display (more info) and monolog's html emails...
Push notification SDK(AnPush、Bark、Chanify、DingTalk、Discord、Gitter、GoogleCh...
Version History
| Version | Released | PHP | Laravel | License |
|---|---|---|---|---|
| v1.4.1 | ^7.4| | ^10.0| | MIT | |
| v1.4.0 | ^7.4| | ^10.0| | MIT | |
| v1.3.0 | ^7.4| | ^10.0| | MIT | |
| v1.2.0 | MIT | |||
| v1.1.0 | MIT | |||
| v1.0.5 | MIT | |||
| v1.0.4 | MIT | |||
| v1.0.3 | MIT | |||
| v1.0.2 | MIT | |||
| v1.0.1 | MIT | |||
| v1.0.0 | MIT |