yoginth/telegram-logger

维护者

详细信息

gitlab.com/yo/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

  • 将日志发送到Telegram聊天。
  • 接受字符串、数组、对象、json;

安装

composer require yoginth/telegram-logger

发布配置

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

编辑app/config/telegramLog.php并填写您的Telegram机器人令牌和chatId或添加环境变量。

<?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'),
];

用法

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