PHPackages                             sky/yii2-slack-client - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. sky/yii2-slack-client

ActiveYii2-extension

sky/yii2-slack-client
=====================

Yii2 slack client and error target

v2.0.3(4y ago)33.4k1Apache-2.0PHPPHP &gt;=5.6.0

Since Jan 18Pushed 4y ago2 watchersCompare

[ Source](https://github.com/rockman84/yii2-slack-client)[ Packagist](https://packagist.org/packages/sky/yii2-slack-client)[ RSS](/packages/sky-yii2-slack-client/feed)WikiDiscussions master Synced today

READMEChangelog (6)Dependencies (2)Versions (10)Used By (1)

yii2-slack-client
=================

[](#yii2-slack-client)

Install Package
---------------

[](#install-package)

```
php composer.phar require sky/yii2-slack-client "*"

```

or add in composer.json

```
"sky/yii2-slack-client" : "*"

```

Set Client Configuration
------------------------

[](#set-client-configuration)

```
'message' => [
    'class' => 'sky\slack\SlackClient',
    'defaultChannel' => 'general',
    'webhookUrls' => [
        // channels web hook
        'general' => 'https://hooks.slack.com/services/[key]',
        'error' => 'https://hooks.slack.com/services/[key]',
        'tester' => 'https://hooks.slack.com/services/[key]',
    ],
],

```

Set Up Error Target Configuration (Optional)
--------------------------------------------

[](#set-up-error-target-configuration-optional)

```
'log' => [
    'traceLevel' => YII_DEBUG ? 3 : 0,
    'targets' => [
        [
            'class' => 'sky\slack\SlackTarget',
            'levels' => ['error', 'warning'],
            'channel' => 'error',
        ],
    ],
],

```

Basic how to use
----------------

[](#basic-how-to-use)

```
use sky\slack\SlackClient;
use Yii;

Yii::$app->message->sendText('Hello World');

Yii::$app->message->setChannel('tester')->sendText('Hello World');

// use attachment
Yii::$app->message->send([
    'text' => 'Hello World',
    'attachments' => [
        [
            'text' => 'Attachment 1',
            'fields' => SlackClient::fieldsAttribute($model, [
                'id',
                'name',
                'country' => 'country.name',
            ])
        ]
    ],
]);

```

Slack Builder
-------------

[](#slack-builder)

```
$builder = Yii::$app->message->createBuilder();
// or
$builder = new SlackBuilder();

// set text
$builder->setText('Hello World');

// add Blocks
$builder->addHeaderBlock(['text' => 'Helllo']);
$builder->addDividerBlock();

$sectionBlock = new SectionBlock(['text' => 'this is object block']);
$builder->addBlock($section);

// send builder
$builder->send();

// or
$builder->send(Yii::$app->message);

// or
Yii::$app->message->sendBuilder($builder);
```

If this library is useful for you, say thanks [buying me a beer 🍺](https://www.paypal.me/huanghanzen)!

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity20

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~165 days

Recently: every ~247 days

Total

7

Last Release

1680d ago

Major Versions

v1.0.2 → v2.0.02021-08-27

### Community

Maintainers

![](https://www.gravatar.com/avatar/457fb0aadfdff9bd8118917fae32f7aadef5f4f65196c7c4a1d38a2980e0c827?d=identicon)[rockman84](/maintainers/rockman84)

---

Top Contributors

[![rockman84](https://avatars.githubusercontent.com/u/2102386?v=4)](https://github.com/rockman84 "rockman84 (47 commits)")

### Embed Badge

![Health badge](/badges/sky-yii2-slack-client/health.svg)

```
[![Health](https://phpackages.com/badges/sky-yii2-slack-client/health.svg)](https://phpackages.com/packages/sky-yii2-slack-client)
```

###  Alternatives

[tuyakhov/yii2-notifications

The extension provides support for sending notifications across a variety of delivery channels, including mail, SMS, Slack etc. Notifications may also be stored in a database so they may be displayed in your web interface.

6735.5k2](/packages/tuyakhov-yii2-notifications)[zhuravljov/yii2-rest

Yii2 REST Client

1186.2k](/packages/zhuravljov-yii2-rest)[hprose/hprose-yii

Hprose Server for Yii 2

357.1k](/packages/hprose-hprose-yii)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
