PHPackages                             spatie/interactive-slack-notification-channel - 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. spatie/interactive-slack-notification-channel

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

spatie/interactive-slack-notification-channel
=============================================

Send interactive Slack notifications in Laravel apps

1.4.0(1mo ago)6571.7k↓14.2%61MITPHPPHP ^8.3CI passing

Since Jan 20Pushed 8mo ago3 watchersCompare

[ Source](https://github.com/spatie/interactive-slack-notification-channel)[ Packagist](https://packagist.org/packages/spatie/interactive-slack-notification-channel)[ Docs](https://github.com/spatie/interactive-slack-notification-channel)[ GitHub Sponsors](https://github.com/spatie)[ RSS](/packages/spatie-interactive-slack-notification-channel/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (19)Versions (14)Used By (1)

Send interactive Slack notifications in Laravel apps
====================================================

[](#send-interactive-slack-notifications-in-laravel-apps)

[![Latest Version on Packagist](https://camo.githubusercontent.com/92d7fd27bbd3bcf4ef5075d25035408e86b8dc88ce15bf6bb5b778eb96bae629/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7370617469652f696e7465726163746976652d736c61636b2d6e6f74696669636174696f6e2d6368616e6e656c2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/spatie/interactive-slack-notification-channel)[![Tests](https://github.com/spatie/interactive-slack-notification-channel/workflows/Tests/badge.svg)](https://github.com/spatie/interactive-slack-notification-channel/workflows/Tests/badge.svg)[![Total Downloads](https://camo.githubusercontent.com/2247370cc411c96ef5acc4b64ddf02d70fdcd12061fec533c90edcb22ebd1e82/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7370617469652f696e7465726163746976652d736c61636b2d6e6f74696669636174696f6e2d6368616e6e656c2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/spatie/interactive-slack-notification-channel)

This package allows you to send interactive Slack notifications. Here's how such a notification could look like

[![](https://github.com/spatie/interactive-slack-notification-channel/raw/main/docs/images/notification.png)](https://github.com/spatie/interactive-slack-notification-channel/blob/main/docs/images/notification.png)

Support us
----------

[](#support-us)

[![](https://camo.githubusercontent.com/2c913a12cb5790392193e1f8d29ffda4b38c00cddfec6d66606c62516cea3b73/68747470733a2f2f6769746875622d6164732e73332e65752d63656e7472616c2d312e616d617a6f6e6177732e636f6d2f696e7465726163746976652d736c61636b2d6e6f74696669636174696f6e2d6368616e6e656c2e6a70673f743d31)](https://spatie.be/github-ad-click/interactive-slack-notification-channel)

We invest a lot of resources into creating [best in class open source packages](https://spatie.be/open-source). You can support us by [buying one of our paid products](https://spatie.be/open-source/support-us).

We highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using. You'll find our address on [our contact page](https://spatie.be/about-us). We publish all received postcards on [our virtual postcard wall](https://spatie.be/open-source/postcards).

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

[](#installation)

You can install the package via composer:

```
composer require spatie/interactive-slack-notification-channel
```

Usage
-----

[](#usage)

In your `Notifiable` classes you should add a method named `routeNotificationForInteractiveSlack` that returns an array with the API token, an optionally the channel name

```
public function routeNotificationForInteractiveSlack()
{
    return [
        'token' => 'xoxp-slack-token',
        'channel' => '#general' // this is optional
    ];
}
```

### Replying to message threads

[](#replying-to-message-threads)

Let's assume you want your application to send a Slack notification when an order gets placed. You also want any subsequent messages about the order be place in the same thread.

Using the SlackApi channels you can retrieve the API response from Slack's `chat.postMessage` method. With this response you could post messages on other events that happen on the order, such as order paid, shipped, closed, etc.

Here's an example:

```
use Spatie\InteractiveSlackNotificationChannel\Messages\SlackMessage

public function toInteractiveSlack($notifiable)
{
    return (new SlackMessage)->content('A new order has been placed');
}

public function interactiveSlackResponse(array $response)
{
    $this->order->update(['slack_thread_ts' => $response['ts']]);
}
```

In your order paid event you can have

```
use Spatie\InteractiveSlackNotificationChannel\Messages\SlackMessage;
use Spatie\InteractiveSlackNotificationChannel\Messages\SlackAttachment;

public function toInteractiveSlack($notifiable)
{
    $order = $this->order;

    return (new SlackMessage)
        ->success()
        ->content('Order paid')
        ->threadTimestamp($order->slack_thread_ts)
        ->attachment(function(SlackAttachment $attachment) use ($order) {
           $attachment
                ->title("Order $order->reference has been paid for.")
                ->content('Should now be processed.')
                ->action('View Order', route('orders', $order->reference));
       });
}
```

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](https://github.com/spatie/.github/blob/main/CONTRIBUTING.md) for details.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [Freek Van der Herten](https://github.com/freekmurze)
- [All Contributors](../../contributors)

Some parts of the code and readme are based on [this package](https://github.com/beyondcode/slack-notification-channel).

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

57

—

FairBetter than 98% of packages

Maintenance73

Regular maintenance activity

Popularity45

Moderate usage in the ecosystem

Community20

Small or concentrated contributor base

Maturity75

Established project with proven stability

 Bus Factor1

Top contributor holds 83.5% 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 ~171 days

Recently: every ~293 days

Total

12

Last Release

53d ago

Major Versions

0.0.4 → 1.0.02021-01-26

PHP version history (3 changes)0.0.1PHP ^8.0

1.3.0PHP ^8.2

1.4.0PHP ^8.3

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/7535935?v=4)[Spatie](/maintainers/spatie)[@spatie](https://github.com/spatie)

---

Top Contributors

[![freekmurze](https://avatars.githubusercontent.com/u/483853?v=4)](https://github.com/freekmurze "freekmurze (71 commits)")[![alies-dev](https://avatars.githubusercontent.com/u/5278175?v=4)](https://github.com/alies-dev "alies-dev (5 commits)")[![AdrianMrn](https://avatars.githubusercontent.com/u/12762044?v=4)](https://github.com/AdrianMrn "AdrianMrn (4 commits)")[![AlexVanderbist](https://avatars.githubusercontent.com/u/6287961?v=4)](https://github.com/AlexVanderbist "AlexVanderbist (2 commits)")[![jpedrols](https://avatars.githubusercontent.com/u/19982365?v=4)](https://github.com/jpedrols "jpedrols (1 commits)")[![resohead](https://avatars.githubusercontent.com/u/13508056?v=4)](https://github.com/resohead "resohead (1 commits)")[![riasvdv](https://avatars.githubusercontent.com/u/3626559?v=4)](https://github.com/riasvdv "riasvdv (1 commits)")

---

Tags

apiinteractivelaravelnotificationsphpspatieinteractive-slack-notification-channel

###  Code Quality

TestsPest

### Embed Badge

![Health badge](/badges/spatie-interactive-slack-notification-channel/health.svg)

```
[![Health](https://phpackages.com/badges/spatie-interactive-slack-notification-channel/health.svg)](https://phpackages.com/packages/spatie-interactive-slack-notification-channel)
```

###  Alternatives

[laravel-notification-channels/telegram

Telegram Notifications Channel for Laravel

1.1k3.4M35](/packages/laravel-notification-channels-telegram)[spatie/laravel-honeypot

Preventing spam submitted through forms

1.6k6.0M60](/packages/spatie-laravel-honeypot)[spatie/laravel-health

Monitor the health of a Laravel application

86910.0M83](/packages/spatie-laravel-health)[spatie/laravel-export

Create a static site bundle from a Laravel app

646127.9k5](/packages/spatie-laravel-export)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9682.1M97](/packages/roots-acorn)[spatie/laravel-enum

Laravel Enum support

3655.4M31](/packages/spatie-laravel-enum)

PHPackages © 2026

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