viodev/laravel-slack

Laravel package for sending slack message.
7,653 2
Install
composer require viodev/laravel-slack
Latest Version:1.3.0
PHP:^8.0
License:MIT
Last Updated:May 14, 2025
Links: GitHub  ·  Packagist
Maintainer: viodev

Laravel slack

Send messages to slack from Laravel application.

Installation

composer require viodev/laravel-slack

Publish config

php artisan vendor:publish --tag="slack-config"

Usage

Basic message

Send simple message

use Viodev\Slack;

Slack::to('info')->message('My simple message');
Send blocks

Send complex message with contextual blocks

use Viodev\Slack;

// Create slack instance with title going to info channel

$slack = Slack::to('info')->title('My message title');

// Start first block with success trim

$slack->block('Key 1', 'Value 2')->success(); // Set success trim for current block
$slack->addToBlock('Key 2', 'Value 2');
$slack->addToBlock('Key 3', 'Value 3');

// Start 2nd block with error trim

$slack->newBlock('Errors', '1 error occurred');
$slack->addToBlock('Error 1', 'Exception 1')->error(); // Set error trim for current block

// Complete block and send

$slack->send();

Related Packages

spatie/laravel-failed-job-monitor

Get notified when a queued job fails

3,053,158 1,057
razorpay/slack-laravel

Laravel 4 and 5 integration for the razorpay/slack package, including facades an...

377,536 18
nicolasmahe/laravel-slack-output

Sends a message to Slack when something goes wrong with your Laravel application...

42,975 27
tlapi/slack-laravel

Laravel 4 and 5 integration for the maknz/slack package, including facades and s...

137,449 1
maknz/slack-laravel

Laravel 4 and 5 integration for the maknz/slack package, including facades and s...

991,285 154