PHP code example of bossit / yii2-telegram-logger

1. Go to this page and download the library: Download bossit/yii2-telegram-logger library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

bossit / yii2-telegram-logger example snippets


'components' => [
    'telegramLogger' => [
        'class'     => \bossit\logger\TelegramService::class,
        'botKey'    => 'xxx:zzz',
        'botName'   => 'YouNameBot',
        'channelId' => '-100xxx'
    ],
],

\Yii::$app->telegramLogger->push('Hello, %username%!');

\Yii::$app->telegramLogger->push('Hello, %username%!', 'Authorization');