PHPackages                             hidalgo-rides/slack-notifier - 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. [HTTP &amp; Networking](/categories/http)
4. /
5. hidalgo-rides/slack-notifier

ActiveLibrary[HTTP &amp; Networking](/categories/http)

hidalgo-rides/slack-notifier
============================

PHP client built for integrating with Slack's Incoming Webhooks

1.0.1(6y ago)313MITPHPPHP ^7.1.3

Since Jul 27Pushed 6y ago1 watchersCompare

[ Source](https://github.com/HidalgoRides/slack-notifier)[ Packagist](https://packagist.org/packages/hidalgo-rides/slack-notifier)[ RSS](/packages/hidalgo-rides-slack-notifier/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependencies (3)Versions (3)Used By (0)

Slack Notifier
==============

[](#slack-notifier)

Slack Notifier utilitizes Slack's [Incoming Webhooks](https://slack.com/apps/A0F7XDUAZ-incoming-webhooks) feature to post messages directly to a Slack channel of your choosing through your individual Slack app Webhook URL.

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

[](#installation)

These instructions assume you already have Composer installed on your machine or the server you are working on.

Install through Composer:

```
composer require timkippdev/slack-notifier
```

Usage
-----

[](#usage)

### Creating Slack App and Enabling Incoming Webhooks

[](#creating-slack-app-and-enabling-incoming-webhooks)

See the following instructions provided by Slack to create your app, if needed, and obtain your Webhook URL:

### Setup `SlackNotifier` Instance

[](#setup-slacknotifier-instance)

Once you have your Webhook URL, you can create a new instance of the `SlackNotifier` class:

```
// your Webhook URL
$webhookAPI = 'https://hooks.slack.com/services/Txxxxxx/Byyyyyyy/Zzzzzzzzz';

// new SlackNotifier instance
$slackNotifier = new \TimKippDev\SlackNotifier\SlackNotifier($webhookAPI);
```

> You can also choose to invoke the static `sendMessageToChannel` method instead of creating your own instance.

### Sending Messages

[](#sending-messages)

Now that you have your `SlackNotifier` instance created, you can use it to send a message with optional attachments to the channel configured from your Webhook URL.

#### Simple Message Using Instance Method

[](#simple-message-using-instance-method)

```
$slackNotifier->sendMessage('First message using Slack Notifier!');
```

#### Simple Message Using Static Method

[](#simple-message-using-static-method)

We provide a static method to invoke to easily send messages to different channels so you are not tied down to a single instance.

```
\TimKippDev\SlackNotifier\SlackNotifier::sendMessageToChannel($webhookAPI, 'First message using Slack Notifier!');
```

#### Message with Attachments

[](#message-with-attachments)

For the complete Slack message attachment documentation, see the following link:

```
$slackAttachment = new \TimKippDev\SlackNotifier\SlackAttachment();
$slackAttachment
    ->setAuthorName('Author name goes here')
    ->setAuthorLinkUrl('https://example.com/author')
    ->setAuthorIconUrl('https://img.icons8.com/ultraviolet/48/000000/soy.png')
    ->setColor('#222222')
    ->setFallbackText('Fallback goes here')
    ->setFooterIconUrl('https://img.icons8.com/color/48/000000/soy.png')
    ->setFooterText('Footer text goes here')
    ->setImageUrl('https://img.icons8.com/color/400/000000/soy.png')
    ->setPretext('Pretext goes here')
    ->setText('Attached using Slack Notifier!')
    ->setThumbnailUrl('https://img.icons8.com/ultraviolet/96/000000/soy.png')
    ->setTitle('Title goes here')
    ->setTitleLinkUrl('https://example.com/title');

// with instance method
$slackNotifier->sendMessage('First message with attachments using Slack Notifier!', [
    $slackAttachment
]);

// with static method
\TimKippDev\SlackNotifier\SlackNotifier::sendMessageToChannel($webhookAPI, 'First message using Slack Notifier!', [
    $slackAttachment
]);
```

#### Attachment Actions

[](#attachment-actions)

```
$slackActionConfirmation = new \TimKippDev\SlackNotifier\SlackActionConfirmation();
$slackActionConfirmation->setDismissButtonText('Dismiss')
    ->setOkButtonText('Confirm')
    ->setText('Confirmation Text')
    ->setTitle('Confirmation Title');

$slackAction = new \TimKippDev\SlackNotifier\SlackAction();
$slackAction->setStyle('primary')
    ->setType('button')
    ->setText('Click Me with Confirmation')
    ->setUrl('https://example.com/action')
    ->setName('action-name')
    ->setConfirmation($slackActionConfirmation);

$slackAttachment = new \TimKippDev\SlackNotifier\SlackAttachment();
$slackAttachment
    ->setText('Attached using Slack Notifier!')
    ->setActions([$slackAction]);

// with instance method
$slackNotifier->sendMessage('First message attachment containing actions using Slack Notifier!', [
    $slackAttachment
]);

// with static method
\TimKippDev\SlackNotifier\SlackNotifier::sendMessageToChannel($webhookAPI, 'First message using Slack Notifier!', [
    $slackAttachment
]);
```

#### Attachment Fields

[](#attachment-fields)

```
$slackField = new \TimKippDev\SlackNotifier\SlackField();
$slackField->setTitle('Field Title')
    ->setValue('Field Value');

$slackAttachment = new \TimKippDev\SlackNotifier\SlackAttachment();
$slackAttachment
    ->setText('Attached using Slack Notifier!')
    ->setFields([$slackField]);

// with instance method
$slackNotifier->sendMessage('First message attachment containing fields using Slack Notifier!', [
    $slackAttachment
]);

// with static method
\TimKippDev\SlackNotifier\SlackNotifier::sendMessageToChannel($webhookAPI, 'First message using Slack Notifier!', [
    $slackAttachment
]);
```

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

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

Total

2

Last Release

2478d ago

### Community

Maintainers

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

---

Top Contributors

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

---

Tags

notifierslackwebhooksincomingtimkippdev

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/hidalgo-rides-slack-notifier/health.svg)

```
[![Health](https://phpackages.com/badges/hidalgo-rides-slack-notifier/health.svg)](https://phpackages.com/packages/hidalgo-rides-slack-notifier)
```

###  Alternatives

[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)[airbrake/phpbrake

Airbrake exception and error notifier for PHP

492.0M25](/packages/airbrake-phpbrake)[renoki-co/laravel-aws-webhooks

Easy webhook handler for Laravel to catch AWS SNS notifications for various services.

73248.5k](/packages/renoki-co-laravel-aws-webhooks)[binary-cats/laravel-mailgun-webhooks

Handle Mailgun webhooks in a Laravel application

64299.4k](/packages/binary-cats-laravel-mailgun-webhooks)[wrapi/slack

Wrapper for Slack Web API

56272.3k2](/packages/wrapi-slack)[monolog-http/monolog-http

A collection of monolog handlers using PSR-18 http client

416.1k](/packages/monolog-http-monolog-http)

PHPackages © 2026

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