Download the PHP package marshmallow/slack-extended-envoy without Composer
On this page you can find all versions of the php package marshmallow/slack-extended-envoy. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download marshmallow/slack-extended-envoy
More information about marshmallow/slack-extended-envoy
Files in marshmallow/slack-extended-envoy
Package slack-extended-envoy
Short Description Rich Text notification for Laravel Envoy
License MIT
Informations about the package slack-extended-envoy

Slack Extended for Laravel Envoy
Rich Text notification for Laravel Envoy.
This package sends a richly formatted Slack message from your Laravel Envoy deployment scripts. Instead of a plain line of text, it posts a Slack Block Kit attachment with a colored success/failure header, the release number, deployment details (host, branch, PHP version, the user who triggered the deploy) and a button linking back to GitHub.
Installation
Install the package via Composer:
Usage
The entry point is the Marshmallow\SlackExtended\SlackExtended class. Build a message with make(), optionally set the failing task with task(), and call send() to post it to your Slack Incoming Webhook.
Constructor / make() arguments
| Argument | Type | Default | Description |
|---|---|---|---|
hook |
string |
— | The Slack Incoming Webhook URL to post the message to. |
channel |
mixed |
'' |
The Slack channel the message is posted to. |
options |
array |
[] |
The deployment details rendered in the message (see below). When empty, a set of placeholder values is used. |
success |
bool |
false |
Whether the deployment succeeded. Controls the header text, color (green/red) and image. |
The options array is rendered into the message body and recognises these keys:
| Key | Description |
|---|---|
host |
The host the deployment ran on. |
release |
The release number, shown as #{release}. |
user |
The user that triggered the deployment. Known handles (LTKort, stefvanesch, lucienversendaal) are mapped to a Slack mention; others render as "Unknown user". |
branch |
The branch that was deployed. |
php_version |
The PHP version used for the deployment. |
github_url |
The URL the "View" button links to. |
Reporting the failing task
When a deployment fails, use task() to include the name of the task that failed in the message. task() is chainable and returns the instance:
Using it from Envoy
Call the package from your Envoy.blade.php deployment hooks, for example in @error and @finished:
Credits
Security Vulnerabilities
Please report security vulnerabilities by email rather than via the public issue tracker.
License
The MIT License. Please see the License File for more information.