Laravel Slack Notification Channel
Official Laravel notification channel for sending Slack messages
Repository Health
Technical Analysis
The Laravel Slack Notification Channel plugs Slack delivery into Laravel’s built-in Notification system, letting any Notification class render a SlackMessage and send it via an incoming webhook or an OAuth-connected Slack app route. It ships a full, typed Block Kit builder (sections, headers, dividers, actions, images, select menus) so notifications can be built as structured Slack UI rather than plain text.
Maintained directly by the Laravel team, it is the first-party way to add Slack alerts to any Laravel application — deployment notices, error alerts, billing events, or any other notifiable event — using the same ->via(['slack']) API developers already use for mail, database, and SMS channels.
What You Get
- A
slacknotification channel usable with Laravel’s standardvia()/toSlack()Notification API - A fluent
SlackMessagebuilder covering Block Kit blocks: sections, headers, dividers, actions, context, and images - Support for both incoming-webhook delivery and OAuth-routed delivery to a specific Slack channel via
SlackRoute - Interactive elements (buttons, select menus, user selects) for building actionable Slack notifications
- A
SlackChannelServiceProviderthat auto-registers with Laravel’s package discovery
Common Use Cases
- Alerting an ops channel when a deployment, queue failure, or scheduled job fails
- Notifying a sales or support Slack channel when a new lead, order, or support ticket is created
- Sending interactive approval requests (buttons/select menus) to a Slack channel from a Laravel workflow
- Routing different notification types to different Slack channels via per-notifiable
routeNotificationForSlack()
Under The Hood
Architecture - The package layers two concerns: a Laravel-facing SlackWebhookChannel/SlackNotificationRouterChannel that Laravel’s Notification dispatcher calls, and an independent Slack\ namespace implementing a typed Block Kit object model (contracts for BlockContract, ElementContract, ObjectContract, concrete block/element classes under Slack/BlockKit/). SlackRoute and EventMetadata encapsulate the destination (webhook vs. OAuth token + channel) so the channel driver can dispatch through Guzzle to either the classic webhook endpoint or the Slack Web API chat.postMessage style route.
Tech Stack - PHP 8+, built on guzzlehttp/guzzle for HTTP delivery and Laravel’s illuminate/notifications, illuminate/http, and illuminate/support components (supporting Laravel 9 through 13). Static analysis is enforced via PHPStan, and tests run through PHPUnit with orchestra/testbench to boot a minimal Laravel app in isolation.
Code Quality - Test coverage is thorough and organized: dedicated unit tests per Block Kit element (HeaderBlockTest, ButtonElementTest, SelectElementTest, etc.) alongside feature tests for the channel and message-building flow (SlackChannelTest, SlackMessageTest). The Block Kit classes follow a consistent contract-based pattern (each block/element implements a shared interface), which keeps the object model predictable as new Slack Block Kit features are added.
API Design - The channel integrates with zero new concepts for existing Laravel developers: notifications simply add 'slack' to their via() array and implement toSlack() returning a SlackMessage. The fluent SlackMessage/Block Kit builder mirrors Slack’s own Block Kit JSON structure closely, so developers already familiar with Slack’s API documentation can map concepts directly onto the builder’s method names.
Used by 3 apps in this directory
Akaunting
Invoicing Finance
Open-source online accounting for small businesses and freelancers — invoices, expenses, and reporting without monthly fees or vendor lock-in.
Databasement
Databases · Devops · Developer Tools
Self-hosted database backup manager with a web UI for scheduling, encrypting, and restoring MySQL, PostgreSQL, MongoDB, SQL Server, SQLite, Firebird, and Redis to S3, SFTP, Samba, or local storage.
Invoice Ninja
Invoicing Finance · Project Management
Self-hostable invoicing, time-tracking, and multi-gateway payment platform for freelancers and small businesses, with built-in e-invoicing compliance for EU and global standards.