PHPackages                             yiier/yii2-slack - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. yiier/yii2-slack

ActiveYii2-extension[Utility &amp; Helpers](/categories/utility)

yiier/yii2-slack
================

Yii2 slack client based library

v1.1.0(9y ago)416.6kGPL-3.0PHP

Since Jun 1Pushed 9y ago1 watchersCompare

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

READMEChangelog (2)Dependencies (1)Versions (3)Used By (0)

Yii2 Slack integration
======================

[](#yii2-slack-integration)

Designed to send messages to slack messenger

[![How it looks](https://camo.githubusercontent.com/c40f34de3a2e40abf85c7a5be33a97d13b8983775ff0e59d8faebadf7f55c130/687474703a2f2f646e2e696d6167792e6d652f3230313630322f31352f31326437646165313062666239366331353966343839303164353138653139362e706e67)](https://camo.githubusercontent.com/c40f34de3a2e40abf85c7a5be33a97d13b8983775ff0e59d8faebadf7f55c130/687474703a2f2f646e2e696d6167792e6d652f3230313630322f31352f31326437646165313062666239366331353966343839303164353138653139362e706e67)

Installation
------------

[](#installation)

```
php composer.phar require --prefer-dist yiier/yii2-slack "*"
```

Also, you should configure [incoming webhook](https://api.slack.com/incoming-webhooks) inside your Slack team.

Usage
-----

[](#usage)

Configure component:

```
...
    'components' => [
        'slack' => [
            'httpClient' => ['class' => 'Curl\Curl'],
            'class' => 'yiier\slack\Client',
            'url' => '',
            'username' => 'My awesome application',
        ],
    ],
...
```

Now you can send messages right into slack channel via next command:

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

To learn more about attachments, [read Slack documentation](https://api.slack.com/incoming-webhooks)

Also you can use slack as a log target:

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

or

```
...
'components' => [
    'log' => [
        'traceLevel' => 3,
        [
            'class' => 'yiier\slack\LogTarget',
            'levels' => ['error'],
            'enabled' => true,
            'emoji' => ':beetle:',
            'logMessage' => '错误信息',
            'categories' => [
                'yii\db\*',
                'yii\web\HttpException:*',
                'error',
            ],
            'except' => [
                'yii\web\HttpException:404', // 除了404错误
            ],
            'exportInterval' => 1, // Send logs on every message
            'logVars' => [],
        ],
    ],
],
...
```

Credits
-------

[](#credits)

[Understeam/yii2-slack](https://github.com/Understeam/yii2-slack)

###  Health Score

33

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity27

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity64

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 ~50 days

Total

2

Last Release

3634d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/4c0612f70d09feb06ab5d24a31e0cc551f1ee547b42308c695e34d76181f18cf?d=identicon)[forecho](/maintainers/forecho)

---

Top Contributors

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

---

Tags

slackyii2extension

### Embed Badge

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

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

###  Alternatives

[dmstr/yii2-cookie-consent

Yii2 Cookie Consent Widget

1455.6k](/packages/dmstr-yii2-cookie-consent)[imanilchaudhari/yii2-currency-converter

This extension will help to find out current currency conversion rate.

2111.7k](/packages/imanilchaudhari-yii2-currency-converter)[richardfan1126/yii2-js-register

Yii2 widget to register JS into view

1359.3k7](/packages/richardfan1126-yii2-js-register)

PHPackages © 2026

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