Laravel Slack Notification Channel

Official Laravel notification channel for sending Slack messages

SDK
Composer
vv3.10.0
893stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
69/100Good
Development Activity68
Maintenance60
Community60
Maturity60
Momentum28

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
74/100Good
Architecture75
Code Quality78
Innovation62
Learning Curve80

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 slack notification channel usable with Laravel’s standard via()/toSlack() Notification API
  • A fluent SlackMessage builder 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 SlackChannelServiceProvider that 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.

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers

Search