News

Laravel Slack Notification Channel Supports BlockKit API

Published
Laravel Slack Notification Channel Supports BlockKit API image

The Laravel team released improvements to the Slack notification channel to support the Slack Block Kit API for building rich, interactive notifications. This includes major improvements to the documentation, including instructions on sending Slack notifications to external workspaces:

return (new SlackMessage)
    ->text('One of your invoices has been paid!')
    ->headerBlock('Invoice Paid')
    ->contextBlock(function (ContextBlock $block) {
        $block->text('Customer #1234');
    })
    ->sectionBlock(function (SectionBlock $block) {
        $block->text('An invoice has been paid.');
        $block->field("*Invoice No:*\n1000")->markdown();
        $block->field("*Invoice Recipient:*\ntaylor@laravel.com")->markdown();
    })
    ->dividerBlock()
    ->sectionBlock(function (SectionBlock $block) {
        $block->text('Congratulations!');
    });

The updated Laravel docs also include information about Slack interactivity with this notification channel that can handle user interaction.

The documentation also includes updated instructions on notifying external Slack workspaces owned by your application users. Socialite has been updated to obtain a bot token easily.

Read more about these updates in the Slack Notifications documentation. If you are interested in the Slack notification updates, check out Pull Request #64 in the · laravel/slack-notification-channel GitHub repo.

Paul Redmond photo

Staff writer at Laravel News. Full stack web developer and author.

Filed in

Sponsored

laravelcloud logo
Laravel Cloud

Easily create and manage your servers and deploy your Laravel applications in seconds.

Visit Laravel Cloud

The latest

View all →
Live Props for Real-Time Updates in Inertia.js v3.11 image

Live Props for Real-Time Updates in Inertia.js v3.11

Read article
Cooldown Dependency Policy now in Composer 2.11 image

Cooldown Dependency Policy now in Composer 2.11

Read article
Email Sending and Testing for Laravel in One Account image

Email Sending and Testing for Laravel in One Account

Read article
Decide with Jev: Tie Every AI Check to the Exact Draft image

Decide with Jev: Tie Every AI Check to the Exact Draft

Read article
PIE 1.5 Changes PHP Extension Installs in CI image

PIE 1.5 Changes PHP Extension Installs in CI

Read article
Delete Expired Sessions in Laravel With a Scheduled Command image

Delete Expired Sessions in Laravel With a Scheduled Command

Read article