PHP code example of jdlxnl / slack
1. Go to this page and download the library: Download jdlxnl/slack library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
jdlxnl / slack example snippets
use Jdlx\Slack\Notifications\SlackNotification;
use Jdlx\Slack\Sender;
use Jdlx\Slack\Slack;
use Jdlx\Task\Slack\Attachment\TaskFailure;
$builder = (new TaskFailure())->withJob($job)->withTaskLog($log);
Slack::channel()->notify(
new SlackNotification(
$title,
Sender::persona(Sender::TASK_RUNNER),
$builder->toSlackAttachment()
));