LaravelPackages.net
Acme Inc.
Toggle sidebar
gordonzero/monolog-telegram

Laravel 5.6 Monolog custom telegram channel

6.586
4
1.1
About gordonzero/monolog-telegram

gordonzero/monolog-telegram is a Laravel package for laravel 5.6 monolog custom telegram channel. It currently has 4 GitHub stars and 6.586 downloads on Packagist (latest version 1.1). Install it with composer require gordonzero/monolog-telegram. Discover more Laravel packages by gordonzero or browse all Laravel packages to compare alternatives.

Last updated

Laravel 5.6 Monolog Telegram Notification Handler.

This package will sends an message Via Telegram to a spedified group or user speicifed by the LOG_TELEGRAM_CHAT_ID.

Installation

composer require gordonzero/monolog-telegram

Open up config/logging.php and find the channels key. Add the following channel to the list.

'telegram' => [
    'driver' => 'custom',
    'via'=> \Logger\TelegramLogger::class,
    'botKey' => env('LOG_TELEGRAM_BOT_ID'),
    'chatId' => env('LOG_TELEGRAM_CHAT_ID'),
],

Add the following information to your .env file. Your LOG_TELEGRAM_BOT_ID is for the your bot key and LOG_TELEGRAM_CHAT_ID is the chat ID for a telegram user or channel.

LOG_TELEGRAM_BOT_ID=123456789:ABCDEFGHIJKLMNOPQUSTUFWXYZabcdefghi
LOG_TELEGRAM_CHAT_ID=12345678

This package contains a blank Service Provider. This is only to let you know that the package is detected and working properly.

Side Notes

Currently it does not have any built in methods for figuring out what your CHAT_ID is. This may come in a future version or you can check around for posts that tell you how to find this ID number.

Comments