Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Interactive Slack Notification Channel

Interactive Slack Notification Channel Laravel Package

spatie/interactive-slack-notification-channel

Send interactive Slack notifications from Laravel using Slack Block Kit. Configure a token and optional channel on your Notifiable, post rich messages with buttons/inputs, and use Slack API responses to reply in threads for follow-up order events.

View on GitHub
Deep Wiki
Context7

Send interactive Slack notifications in Laravel apps

Frequently asked questions about Interactive Slack Notification Channel
How do I send a Slack notification with interactive buttons in Laravel using this package?
Extend Laravel’s `Notification` class and use the `SlackMessage` builder to define buttons or modals. For example, add a button with `->attachment(['actions' => [['type' => 'button', 'text' => 'Approve', 'value' => 'approved']]])` in the `toSlack()` method. The package handles Slack’s Block Kit formatting automatically.
What Laravel versions does `spatie/interactive-slack-notification-channel` support?
The package is compatible with Laravel 8.x, 9.x, and 10.x. Check the [GitHub repository](https://github.com/spatie/interactive-slack-notification-channel) for the latest version’s specific Laravel requirements. Always test in your target environment before production deployment.
Do I need to configure a Slack app for this package to work?
Yes. Create a Slack app with `chat:write` and `commands` scopes, then generate an OAuth token (e.g., `xoxp-...`). Store the token in your `.env` file and return it via the `routeNotificationForInteractiveSlack()` method in your `Notifiable` model. The package provides no default Slack app setup—you must configure it manually.
How do I handle button clicks or interactive responses from Slack in my Laravel app?
Set up a webhook endpoint in Slack (e.g., `/slack/interactive`) and route it to a Laravel controller. Use the `SlackInteractiveHandler` class to parse payloads and trigger logic. For example, check the `action.id` to determine which button was clicked and update your database or send follow-up messages.
Can I use this package with Laravel queues for async Slack notifications?
Yes, the package fully supports Laravel’s queue system (database, Redis, etc.). Wrap your notification dispatch in `Notification::route()` or use the `via()` method with `SlackChannel::class` in your `Notification` class. Queue workers will handle the Slack API calls asynchronously.
What happens if Slack’s API is down or rate-limited? Does the package retry or fallback?
The package does not include built-in retry logic or fallback mechanisms. You must implement these yourself, such as using Laravel’s `retryAfter` in the queue or falling back to email via the `via()` method. Monitor Slack’s API status and consider caching failed notifications for later retry.
How do I test interactive Slack notifications in my Laravel app?
Use PHPUnit or Pest to mock Slack’s API responses with `Mockery` or Laravel’s HTTP tests. The package provides mockable interfaces, so you can simulate button clicks or API failures. Test both the notification dispatch and the interactive handler endpoint separately for full coverage.
Is there a limit to how many interactive notifications I can send per second?
Slack’s API enforces rate limits (e.g., 1 message/second per channel). The package does not enforce additional limits, but you should account for this in your Laravel app. Use queues to batch notifications and monitor Slack’s API docs for updates to rate limits.
Can I use this package for multi-step workflows (e.g., approvals with follow-up messages)?
Yes, but you’ll need to manage state manually. Use Slack’s `thread_ts` to reply to the original message and store workflow state in Laravel’s database or cache. For complex flows, consider using Slack’s `modal` or `home` tabs to guide users through steps.
Are there alternatives to this package for sending interactive Slack notifications in Laravel?
Yes, alternatives include `laravel-notification-channels/slack` (basic notifications) or custom solutions using Slack’s API directly. However, this package is unique in its deep Laravel integration (e.g., `Notifiable` contracts) and built-in support for interactive components like buttons and modals without manual API handling.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
davejamesmiller/laravel-breadcrumbs
artisanry/parsedown
christhompsontldr/phpsdk
enqueue/dsn
bunny/bunny
enqueue/test
enqueue/null
enqueue/amqp-tools
milesj/emojibase
bower-asset/punycode
bower-asset/inputmask
bower-asset/jquery
bower-asset/yii2-pjax
laravel/nova
spatie/laravel-mailcoach
spatie/laravel-superseeder
laravel/liferaft
nst/json-test-suite
danielmiessler/sec-lists
jackalope/jackalope-transport