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
Slack Notification Channel

Slack Notification Channel Laravel Package

laravel/slack-notification-channel

Official Laravel notification channel for sending notifications to Slack. Integrates with Laravel’s Notifications system, letting you route messages to Slack channels or users and customize payloads. See Laravel docs for configuration and usage.

View on GitHub
Deep Wiki
Context7

Slack Notification Channel for laravel.

Frequently asked questions about Slack Notification Channel
How do I send a basic Slack notification in Laravel using this package?
First, configure your Slack webhook URL in `config/services.php` under the `slack` key. Then, create a notification class extending `SlackMessage` and use Laravel’s `Notification::send()` method to dispatch it to users or channels. Example: `Notification::send($user, new DeploymentNotification());`.
Does this package support Slack’s interactive messages (buttons, modals, etc.)?
Yes, the package supports Slack’s Block Kit for interactive messages. Extend `SlackMessage` and use the `toSlack()` method to define blocks for buttons, modals, or dynamic content. Refer to Slack’s [Block Kit documentation](https://api.slack.com/block-kit) for syntax.
Which Laravel versions and PHP versions are officially supported?
This package is officially compatible with Laravel 8 through 13 and PHP 8.0 to 8.4. Check the [Laravel documentation](https://laravel.com/docs/notifications#slack-notifications) for version-specific setup instructions.
How do I handle Slack API rate limits in production?
Slack enforces rate limits (e.g., 1 message/sec per channel). To mitigate this, use Laravel’s queue system (e.g., Redis or database queues) to batch notifications. Implement exponential backoff in your queue worker if needed.
Can I send notifications to specific Slack users instead of channels?
Yes, configure the `toUser()` method in your `SlackMessage` class to target individual users by their Slack ID. Ensure your Slack app has the `users:read` scope for user-specific permissions.
How do I test Slack notifications in my Laravel app?
Use Slack’s [Mock API](https://api.slack.com/mock-api) or mock the `SlackWebhookChannel` with Guzzle middleware in PHPUnit/Pest. For UI testing (e.g., BlockKit interactions), use Laravel Dusk to verify message rendering.
What’s the difference between `SlackWebhookChannel` and `SlackChannel`?
`SlackWebhookChannel` sends messages via a direct webhook URL (simpler, no OAuth). `SlackChannel` uses Slack’s API (requires OAuth) and supports advanced features like user-specific messages or interactive components. Choose based on your Slack app setup.
How do I log failed Slack notifications?
Override the `failed()` method in your notification class to log failures to Laravel’s log system or a monitoring tool. Example: `Log::error('Slack notification failed', ['exception' => $exception]);`.
Is there a way to skip notifications for certain environments (e.g., local)?
Yes, implement the `shouldSend()` method in your notification class to conditionally skip notifications. Example: `return app()->environment('production');` to disable in non-production environments.
What are the alternatives to this package for Slack notifications in Laravel?
Alternatives include third-party packages like `spatie/laravel-slack-notification` or custom solutions using Guzzle to call Slack’s API directly. However, this official package offers deeper Laravel integration, BlockKit support, and async queue handling out of the box.
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.
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager
alimarchal/laravel-chart-of-accounts
babenkoivan/elastic-scout-driver
mkwebdesign/filament-watchdog-v5
renatomarinho/laravel-page-speed
zedmagdy/filament-business-hours
renatovdemoura/blade-elements-ui
devgeek/beacon-admin
benjamin-rqt/data-watcher-bundle
atriumphp/atrium
sandermuller/package-boost-laravel
sandermuller/boost-skills
redaxo/core
yusufgenc/filament-api-forge
l3aro/rating-star-for-filament
leek/filament-subtenant-scope
anil/file-picker
broqit/fields-ai