class SlackMessage

Legacy Slack message with attachments.

Properties

string $level

The "level" of the notification (info, success, warning, error).

string|null $username

The username to send the message from.

string|null $icon

The user emoji icon for the message.

string|null $image

The user image icon for the message.

string|null $channel

The channel to send the message on.

string|null $content

The text content of the message.

bool $linkNames

Indicates if channel names and usernames should be linked.

$unfurlLinks

Indicates if a preview of links should be inlined in the message.

bool|null $unfurlMedia

Indicates if a preview of links to media should be inlined in the message.

array $attachments

The message's attachments.

array $http

Additional request options for the Guzzle HTTP client.

Methods

info()

Indicate that the notification gives information about an operation.

success()

Indicate that the notification gives information about a successful operation.

warning()

Indicate that the notification gives information about a warning.

error()

Indicate that the notification gives information about an error.

from(string $username, string|null $icon = null)

Set a custom username and optional emoji icon for the Slack message.

image(string $image)

Set a custom image icon the message should use.

to(string|null $channel)

Set the Slack channel the message should be sent to.

content(string $content)

Set the content of the Slack message.

attachment(Closure $callback)

Define an attachment for the message.

string|null
color()

Get the color for the message.

linkNames()

Find and link channel names and usernames.

unfurlLinks(bool $unfurlLinks)

Unfurl links to rich display.

unfurlMedia(bool $unfurlMedia)

Unfurl media to rich display.

http(array $options)

Set additional request options for the Guzzle HTTP client.

Details

at line 78
SlackMessage info()

Indicate that the notification gives information about an operation.

Return Value

SlackMessage

at line 90
SlackMessage success()

Indicate that the notification gives information about a successful operation.

Return Value

SlackMessage

at line 102
SlackMessage warning()

Indicate that the notification gives information about a warning.

Return Value

SlackMessage

at line 114
SlackMessage error()

Indicate that the notification gives information about an error.

Return Value

SlackMessage

at line 126
SlackMessage from(string $username, string|null $icon = null)

Set a custom username and optional emoji icon for the Slack message.

Parameters

string $username
string|null $icon

Return Value

SlackMessage

at line 142
SlackMessage image(string $image)

Set a custom image icon the message should use.

Parameters

string $image

Return Value

SlackMessage

at line 154
SlackMessage to(string|null $channel)

Set the Slack channel the message should be sent to.

Parameters

string|null $channel

Return Value

SlackMessage

at line 166
SlackMessage content(string $content)

Set the content of the Slack message.

Parameters

string $content

Return Value

SlackMessage

at line 178
SlackMessage attachment(Closure $callback)

Define an attachment for the message.

Parameters

Closure $callback

Return Value

SlackMessage

at line 190
string|null color()

Get the color for the message.

Return Value

string|null

at line 209
SlackMessage linkNames()

Find and link channel names and usernames.

Return Value

SlackMessage

Unfurl links to rich display.

Parameters

bool $unfurlLinks

Return Value

SlackMessage

at line 233
SlackMessage unfurlMedia(bool $unfurlMedia)

Unfurl media to rich display.

Parameters

bool $unfurlMedia

Return Value

SlackMessage

at line 245
SlackMessage http(array $options)

Set additional request options for the Guzzle HTTP client.

Parameters

array $options

Return Value

SlackMessage