yoginth/telegram-logger

1.0.1 2019-10-22 07:13 UTC

This package is auto-updated.

Last update: 2020-07-05 07:13:51 UTC


README

  • Send log to telegram chat.
  • Accept string, array, object, json;

Install

composer require yoginth/telegram-logger

Publish config

php artisan vendor:publish --provider yoginth\laravelTelegramLog\TelegramLogServiceProvider

Edit app/config/telegramLog.php and fill your Telegram Bot token and chatId or add env variables.

<?php

return [
    // Telegram Bot Token
    'token' => env('TELEGRAM_LOG_BOT_TOKEN', '111111:AAF99VnmhsE6HQtH6vsQaBRLctxXs4-UpdY'),

    // Telegram Chat Id
    'chat_id' => env('TELEGRAM_LOG_CHAT_ID', '-1111111111111'),
];

Usage

Telegram::log('test');
Telegram::log(['test' => 'test']);
Telegram::log({"test" : "test"});