viodev/laravel-slack
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
maknz/slack
A simple PHP package for sending messages to Slack, with a focus on ease of use...
12,268,865
1,160
alek13/slack
A simple PHP package (fork of maknz/slack) for sending messages to Slack, with a...
6,138,168
137
nexylan/slack
A simple PHP package for sending messages to Slack, with a focus on ease of use...
1,678,968
104
maknz/slack-laravel
Laravel 4 and 5 integration for the maknz/slack package, including facades and s...
993,957
154
Version History
| Version | Released | PHP | Laravel | License |
|---|---|---|---|---|
| 1.3.0 | ^8.0 | ^7.0| | MIT | |
| 1.2.1 | ^8.0 | ^7.0| | MIT | |
| 1.2.0 | ^8.0 | ^7.0| | MIT | |
| 1.1.0 | ^8.0 | ^7.0| | MIT | |
| 1.0.3 | ^8.0 | ^7.0| | MIT | |
| 1.0.2 | ^8.0 | ^7.0| | MIT | |
| 1.0.1 | ^8.0 | ^7.0| | MIT | |
| 1.0.0 | ^8.0 | ^7.0| | MIT |