PHPackages                             jc21/slack-notifications - 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. [Mail &amp; Notifications](/categories/mail)
4. /
5. jc21/slack-notifications

AbandonedArchivedLibrary[Mail &amp; Notifications](/categories/mail)

jc21/slack-notifications
========================

A PHP interface for sending Notifications to your Slack team

1.3(10y ago)12.8kBSDPHPPHP &gt;=5.3.0

Since Jun 29Pushed 8y ago1 watchersCompare

[ Source](https://github.com/jc21/slack-notifications)[ Packagist](https://packagist.org/packages/jc21/slack-notifications)[ Docs](https://github.com/jc21/slack-notifications)[ RSS](/packages/jc21-slack-notifications/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (4)Dependencies (1)Versions (4)Used By (0)

Slack Notifications from your PHP App
=====================================

[](#slack-notifications-from-your-php-app)

- Send to any Channel or User
- Full webhook options set supported
- Attachments for nice field data display

### Installing via Composer

[](#installing-via-composer)

```
# Install Composer
curl -sS https://getcomposer.org/installer | php
```

Next, run the Composer command to install the latest stable version:

```
composer.phar require jc21/slack-notifications
```

After installing, you need to require Composer's autoloader:

```
require 'vendor/autoload.php';
```

### Using

[](#using)

[Class documentation](docs/Documentation.md)

See the tests folder for some examples, but basically here's how to use it:

```
use jc21\SlackNotification;
use jc21\SlackAttachment;

$webhookUrl = 'your incoming webhook url';
$iconURl    = '';

// Create Attachment first
$attachment = new SlackAttachment();
$attachment->setFallback('Someone has tested the slack-notifications code successfully');
$attachment->setPretext(' was tested');
$attachment->setColor('#00ce3a');
$attachment->setAuthorName('Jamie Curnow');
$attachment->setAuthorLink('http://jc21.com');
$attachment->setAuthorIcon('https://avatars2.githubusercontent.com/u/1518257?v=3&s=460');

// Fields of the Attachment
$attachment->addField('Description', 'slack-notifications is a PHP package to help you out', false);
$attachment->addField('Type',        'Test',                                                 true);
$attachment->addField('Result',      'Success',                                              true);

// The notification, which uses the Attachment
$notification = new SlackNotification($webhookUrl);
$notification->setChannel('#general');  // Use @ for a username. ie: @jc21
$notification->setUsername('slack-notifications');
$notification->setIconUrl($iconUrl);
$notification->addAttachment($attachment);

try {
    $notification->send();
} catch (\Exception $e) {
    print 'Error: ' . $e->getMessage() . PHP_EOL;
    exit(1);
}
```

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity60

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

Total

3

Last Release

3926d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/ac74f1d8680bf428354d9454f004220bbfffc3ff598333ff89777451887e9e12?d=identicon)[jc21](/maintainers/jc21)

---

Top Contributors

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

---

Tags

notificationslack

### Embed Badge

![Health badge](/badges/jc21-slack-notifications/health.svg)

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

###  Alternatives

[symfony/notifier

Sends notifications via one or more channels (email, SMS, ...)

80640.3M290](/packages/symfony-notifier)[guanguans/notify

Push notification SDK(AnPush、Bark、Chanify、DingTalk、Discord、Gitter、GoogleChat、IGot、Lark、Mattermost、MicrosoftTeams、NowPush、Ntfy、Push、Pushback、PushBullet、PushDeer、PushMe、Pushover、PushPlus、QQ、RocketChat、ServerChan、ShowdocPush、SimplePush、Slack、Telegram、WeWork、WPush、XiZhi、YiFengChuanHua、ZohoCliq、ZohoCliqWebHook、Zulip).

682104.9k7](/packages/guanguans-notify)[cuyz/notiz

Handle any type of notification in TYPO3 with ease: emails, SMS, Slack and more. Listen to your own events or provided ones (scheduler task finishing, extension installed, etc…).

1916.9k](/packages/cuyz-notiz)[witty/laravel-push-notification

Laravel 5 Package for sending push notifications to Android and iOS devices

245.0k](/packages/witty-laravel-push-notification)[pyrech/composer-notifier

Display desktop notifications when composer finishes to install / update

411.7k](/packages/pyrech-composer-notifier)

PHPackages © 2026

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