PHPackages                             hampel/slack-message - 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. hampel/slack-message

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

hampel/slack-message
====================

Standalone implementation of Laravel's SlackMessage classes from illuminate/notifications

1.1.0(6y ago)0136MITPHPPHP &gt;=5.5

Since Aug 27Pushed 2y ago1 watchersCompare

[ Source](https://github.com/hampel/slack-message)[ Packagist](https://packagist.org/packages/hampel/slack-message)[ Docs](https://bitbucket.org/hampel/slack-message)[ RSS](/packages/hampel-slack-message/feed)WikiDiscussions master Synced 2mo ago

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

Slack Message Builder
=====================

[](#slack-message-builder)

[![Latest Version on Packagist](https://camo.githubusercontent.com/000c8b8e1dd1fb7123450cc190d72dc1ac116ee09a76bf631135b7f63431be6f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f68616d70656c2f736c61636b2d6d6573736167652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/hampel/slack-message)[![Total Downloads](https://camo.githubusercontent.com/966bda51ac8b34f84d27dd228751b03ab89f57f9fe0d4396c3c2116292be1850/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f68616d70656c2f736c61636b2d6d6573736167652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/hampel/slack-message)[![Open Issues](https://camo.githubusercontent.com/0d433ed1fbf01ecc0ceadffc33e346999c88464c0fda658b7843415e60174bc1/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6973737565732d7261772f68616d70656c2f736c61636b2d6d6573736167652e7376673f7374796c653d666c61742d737175617265)](https://github.com/hampel/slack-message/issues)[![License](https://camo.githubusercontent.com/4a5c8aebc9197e0e6caebd58674c33a3fd822a5e6aab07de05433c584ca6280a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f68616d70656c2f736c61636b2d6d6573736167652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/hampel/slack-message)

Standalone implementation of Laravel's SlackMessage classes from [illuminate/notifications](https://github.com/illuminate/notifications).

This package provides a mechanism for generating correctly formatted Slack messages and sending them via Guzzle. Ideal for use with simple Slack [inbound webhooks](https://api.slack.com/incoming-webhooks), but can also be used with API calls.

By [Simon Hampel](mailto:simon@hampelgroup.com) based on code by [Taylor Otwell](mailto:taylor@laravel.com) and licensed under the [MIT license](https://opensource.org/licenses/MIT).

Prerequisites
-------------

[](#prerequisites)

You will need to supply a Guzzle client (^6.0|^7.0) to send the Slack messages.

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

[](#installation)

To install using composer, run the following command:

`composer require hampel/slack-message`

Usage
-----

[](#usage)

Refer to Laravel's [Slack Notifications](https://laravel.com/docs/6.x/notifications#slack-notifications) documentation for information on generating Slack messages. The syntax is largely the same as that used by Laravel, but we do not need to use Notifiable classes - we can generate and send our Slack Messages directly.

```
use Carbon\Carbon;
use GuzzleHttp\Client;
use Hampel\SlackMessage\SlackMessage;
use Hampel\SlackMessage\SlackWebhook;

$url = 'https://hooks.slack.com/services/';
$slack = new SlackWebhook(new Client());

$message = $slack->message(function ($message) {
    $message
        ->content('Content')
        ->attachment(function ($attachment) {
            $attachment
                ->title('Laravel', 'https://laravel.com')
                ->content('Attachment Content')
                ->fallback('Attachment Fallback')
                ->fields([
                    'Project' => 'Laravel',
                ])
                ->footer('Laravel')
                ->footerIcon('https://laravel.com/fake.png')
                ->markdown(['text'])
                ->author('Author', 'https://laravel.com/fake_author', 'https://laravel.com/fake_author.png')
                ->timestamp(Carbon::now());
        });
});

$slack->send($url, $message);
```

References
----------

[](#references)

- [Slack API documentation](https://api.slack.com/)
- Slack API: [An introduction to messages](https://api.slack.com/docs/messages)
- Laravel: [Slack Notifications](https://laravel.com/docs/6.x/notifications#slack-notifications)
- Laravel Package: [laravel/slack-notification-channel](https://github.com/laravel/slack-notification-channel)

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community7

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

Total

5

Last Release

2401d ago

### Community

Maintainers

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

---

Top Contributors

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

---

Tags

laravelnotificationsslacklaravelslack

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/hampel-slack-message/health.svg)

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

###  Alternatives

[maknz/slack

A simple PHP package for sending messages to Slack, with a focus on ease of use and elegant syntax.

1.2k11.7M65](/packages/maknz-slack)[beyondcode/slack-notification-channel

Slack Notification Channel for Laravel using API tokens.

85525.8k](/packages/beyondcode-slack-notification-channel)[jeremykenedy/slack

A simple PHP package for sending messages to Slack.

10895.4k1](/packages/jeremykenedy-slack)[jivesh/laravel-slack

A minimalist laravel integration for Slack

2536.7k2](/packages/jivesh-laravel-slack)

PHPackages © 2026

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