2017 © Pedro Peláez
 

yii2-extension yii2-slack

Yii2 slack client based on Yii HTTP client

image

understeam/yii2-slack

Yii2 slack client based on Yii HTTP client

  • Sunday, December 4, 2016
  • by AnatolyRugalev
  • Repository
  • 4 Watchers
  • 16 Stars
  • 31,714 Installations
  • PHP
  • 2 Dependents
  • 0 Suggesters
  • 9 Forks
  • 2 Open issues
  • 10 Versions
  • 16 % Grown

The README.md

Yii2 Slack integration

Designed to send messages to slack messenger, (*1)

How it looks, (*2)

Installation

php composer.phar require understeam/yii2-slack:~0.3 --prefer-dist

Also, you should configure incoming webhook inside your Slack team., (*3)

Usage

First of all, configure yiisoft/yii2-httpclient component:, (*4)

...
    'components' => [
        'httpclient' => [
            'class' => 'yii\httpclient\Client',
        ],
    ],
...

Also you can set it up only inside of slack client:, (*5)

...
    'components' => [
        'slack' => [
            'httpclient' => [
                'class' => 'yii\httpclient\Client',
            ],
            ...
        ],
    ],
...

Configure component:, (*6)

...
    'components' => [
        'slack' => [
            'class' => 'understeam\slack\Client',
            'url' => '<slack incoming webhook url here>',
            'username' => 'My awesome application',
        ],
    ],
...

Now you can send messages right into slack channel via next command:, (*7)

Yii::$app->slack->send('Hello', ':thumbs_up:', [
    [
        // attachment object
        'text' => 'text of attachment',
        'pretext' => 'pretext here',
    ],
]);

To learn more about attachments, read Slack documentation, (*8)

Also you can use slack as a log target:, (*9)

...
'components' => [
    'log' => [
        'traceLevel' => 3,
        'targets' => [
            [
                'class' => 'understeam\slack\LogTarget',
                'categories' => ['commandBus'],
                'exportInterval' => 1, // Send logs on every message
                'logVars' => [],
            ],
        ],
    ],
],
...

The Versions

04/12 2016

dev-v1.0-dev

dev-v1.0-dev

Yii2 slack client based on Yii HTTP client

  Sources   Download

MIT

The Requires

 

23/09 2016

dev-master

9999999-dev

Yii2 slack client based on GuzzleHttp library

  Sources   Download

GPL-v3

The Requires

 

23/09 2016

v0.3.0

0.3.0.0

Yii2 slack client based on GuzzleHttp library

  Sources   Download

GPL-v3

The Requires

 

22/07 2016

v0.2.1

0.2.1.0

Yii2 slack client based on GuzzleHttp library

  Sources   Download

GPL-v3

The Requires

 

15/02 2016

v0.1.1

0.1.1.0

Yii2 slack client based on GuzzleHttp library

  Sources   Download

GPL-v3

The Requires

 

15/02 2016

v0.1.0

0.1.0.0

Yii2 slack client based on GuzzleHttp library

  Sources   Download

GPL-v3

The Requires

 

19/06 2015

v0.0.4

0.0.4.0

Yii2 slack client based on GuzzleHttp library

  Sources   Download

GPL-v3

The Requires

 

19/06 2015

v0.0.3

0.0.3.0

Yii2 slack client based on GuzzleHttp library

  Sources   Download

GPL-v3

The Requires

 

19/06 2015

v0.0.2

0.0.2.0

Yii2 slack client based on GuzzleHttp library

  Sources   Download

GPL-v3

The Requires

 

19/06 2015

v0.0.1

0.0.1.0

Yii2 slack client based on GuzzleHttp library

  Sources   Download

GPL-v3

The Requires