indielab / yii2-slack
Yii Post Message to Slack Channel
Installs: 7 715
Dependents: 0
Suggesters: 0
Security: 0
Stars: 3
Watchers: 3
Forks: 0
Open Issues: 0
Requires
- curl/curl: ^1.6 | ^2.0
- yiisoft/yii2: ~2.0.0
Requires (Dev)
- phpunit/phpunit: ^6.0
This package is auto-updated.
Last update: 2024-10-29 05:17:07 UTC
README
Post a message to a Slack Channel. Pedefined functions to enable coloring.
Setup
Add the indielab/yii2-slack
package to your composer.json
composer require indielab/yii2-slack
Add the component to your config in the components section:
'components' => [ // ... 'slack' => [ 'class' => 'Indielab\Slack\Client', 'token' => 'xoxp-1234567891-1234567891-1234567891', 'channel' => 'indielab', 'username' => 'Slack Bot', ] ]
Using in your Application:
Yii::$app->slack->message('Just a Message')->send();
Send colorized Messages:
Yii::$app->slack->danger('Very dangerous!')->send();
- danger
- warning
- success