chornij / yii2-slack
Simple Slack notifier
Installs: 6 222
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Type:yii2-extension
Requires
- yiisoft/yii2: *
This package is not auto-updated.
Last update: 2025-06-07 22:44:50 UTC
README
Simple Slack notifier
Installation
The preferred way to install this extension is through composer.
Either run
php composer.phar require --prefer-dist chornij/yii2-slack "~1.0"
or add
"chornij/yii2-slack": "~1.0"
to the require section of your composer.json
file.
Usage
To use Slack you need to set up Slack component:
'components' => [ 'slack' => [ 'class' => 'chornij\slack\Client', 'url' => 'https://hooks.slack.com/services/T00000000/B00000000/PS0000000000000000000000', 'username' => 'My app backend', ], ],
You can also use it for logging:
'components' => [ 'log' => [ 'targets' => [ 'slack-errors' => [ 'class' => 'chornij\slack\log\SlackTarget', 'levels' => ['error'], 'emoji' => ':monkey_face:', 'exportInterval' => 1, 'logVars' => [], ], ], ], ],