Documentation

SlackMessage
in package

Table of Contents

$attachments  : array<string|int, mixed>
The message's attachments.
$channel  : string|null
The channel to send the message on.
$content  : string
The text content of the message.
$http  : array<string|int, mixed>
Additional request options for the Guzzle HTTP client.
$icon  : string|null
The user emoji icon for the message.
$image  : string|null
The user image icon for the message.
$level  : string
The "level" of the notification (info, success, warning, error).
$linkNames  : bool
Indicates if channel names and usernames should be linked.
$unfurlLinks  : bool
Indicates if you want a preview of links inlined in the message.
$unfurlMedia  : bool
Indicates if you want a preview of links to media inlined in the message.
$username  : string|null
The username to send the message from.
attachment()  : $this
Define an attachment for the message.
color()  : string
Get the color for the message.
content()  : $this
Set the content of the Slack message.
error()  : $this
Indicate that the notification gives information about an error.
from()  : $this
Set a custom username and optional emoji icon for the Slack message.
http()  : $this
Set additional request options for the Guzzle HTTP client.
image()  : $this
Set a custom image icon the message should use.
linkNames()  : $this
Find and link channel names and usernames.
success()  : $this
Indicate that the notification gives information about a successful operation.
to()  : $this
Set the Slack channel the message should be sent to.
unfurlLinks()  : $this
Find and link channel names and usernames.
unfurlMedia()  : $this
Find and link channel names and usernames.
warning()  : $this
Indicate that the notification gives information about a warning.

Properties

$attachments

The message's attachments.

public array<string|int, mixed> $attachments = []

$channel

The channel to send the message on.

public string|null $channel

$content

The text content of the message.

public string $content

$http

Additional request options for the Guzzle HTTP client.

public array<string|int, mixed> $http = []

$icon

The user emoji icon for the message.

public string|null $icon

$image

The user image icon for the message.

public string|null $image

$level

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

public string $level = 'info'

$linkNames

Indicates if channel names and usernames should be linked.

public bool $linkNames = 0

Indicates if you want a preview of links inlined in the message.

public bool $unfurlLinks

$unfurlMedia

Indicates if you want a preview of links to media inlined in the message.

public bool $unfurlMedia

$username

The username to send the message from.

public string|null $username

Methods

attachment()

Define an attachment for the message.

public attachment(Closure $callback) : $this
Parameters
$callback : Closure
Return values
$this

color()

Get the color for the message.

public color() : string
Return values
string

content()

Set the content of the Slack message.

public content(string $content) : $this
Parameters
$content : string
Return values
$this

error()

Indicate that the notification gives information about an error.

public error() : $this
Return values
$this

from()

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

public from(string $username[, string|null $icon = null ]) : $this
Parameters
$username : string
$icon : string|null = null
Return values
$this

http()

Set additional request options for the Guzzle HTTP client.

public http(array<string|int, mixed> $options) : $this
Parameters
$options : array<string|int, mixed>
Return values
$this

image()

Set a custom image icon the message should use.

public image(string $image) : $this
Parameters
$image : string
Return values
$this

linkNames()

Find and link channel names and usernames.

public linkNames() : $this
Return values
$this

success()

Indicate that the notification gives information about a successful operation.

public success() : $this
Return values
$this

to()

Set the Slack channel the message should be sent to.

public to(string $channel) : $this
Parameters
$channel : string
Return values
$this

Find and link channel names and usernames.

public unfurlLinks(string $unfurl) : $this
Parameters
$unfurl : string
Return values
$this

unfurlMedia()

Find and link channel names and usernames.

public unfurlMedia(string $unfurl) : $this
Parameters
$unfurl : string
Return values
$this

warning()

Indicate that the notification gives information about a warning.

public warning() : $this
Return values
$this

Search results