Laravel Slack Notification Channel Supports BlockKit API
Published on by Paul Redmond
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.