PHP code example of chornij / yii2-slack

1. Go to this page and download the library: Download chornij/yii2-slack 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/ */

    

chornij / yii2-slack example snippets


'components' => [
    'slack' => [
        'class' => 'chornij\slack\Client',
        'url' => 'https://hooks.slack.com/services/T00000000/B00000000/PS0000000000000000000000',
        'username' => 'My app backend',
    ],
],

'components' => [
    'log' => [
        'targets' => [
            'slack-errors' => [
                'class' => 'chornij\slack\log\SlackTarget',
                'levels' => ['error'],
                'emoji' => ':monkey_face:',
                'exportInterval' => 1,
                'logVars' => [],
            ],
        ],
    ],
],

php composer.phar