SlackAttachment
class SlackAttachment (View source)
Traits
InteractsWithTime |
Properties
string | $title | The attachment's title. | |
string | $url | The attachment's URL. | |
string | $pretext | The attachment's pretext. | |
string | $content | The attachment's text content. | |
string | $fallback | A plain-text summary of the attachment. | |
string | $color | The attachment's color. | |
array | $fields | The attachment's fields. | |
array | $markdown | The fields containing markdown. | |
string | $imageUrl | The attachment's image url. | |
string | $thumbUrl | The attachment's thumb url. | |
string | $authorName | The attachment author's name. | |
string | $authorLink | The attachment author's link. | |
string | $authorIcon | The attachment author's icon. | |
string | $footer | The attachment's footer. | |
string | $footerIcon | The attachment's footer icon. | |
int | $timestamp | The attachment's timestamp. |
Methods
int | secondsUntil(DateTimeInterface|DateInterval|int $delay) Get the number of seconds until the given DateTime. | from InteractsWithTime |
int | availableAt(DateTimeInterface|DateInterval|int $delay = 0) Get the "available at" UNIX timestamp. | from InteractsWithTime |
DateTimeInterface|int | parseDateInterval(DateTimeInterface|DateInterval|int $delay) If the given value is an interval, convert it to a DateTime instance. | from InteractsWithTime |
int | currentTime() Get the current system time as a UNIX timestamp. | from InteractsWithTime |
$this | title(string $title, string|null $url = null) Set the title of the attachment. | |
$this | pretext(string $pretext) Set the pretext of the attachment. | |
$this | content(string $content) Set the content (text) of the attachment. | |
$this | fallback(string $fallback) A plain-text summary of the attachment. | |
$this | color(string $color) Set the color of the attachment. | |
$this | field(Closure|string $title, string $content = '') Add a field to the attachment. | |
$this | fields(array $fields) Set the fields of the attachment. | |
$this | markdown(array $fields) Set the fields containing markdown. | |
$this | image(string $url) Set the image URL. | |
$this | thumb(string $url) Set the URL to the attachment thumbnail. | |
$this | author(string $name, string|null $link = null, string|null $icon = null) Set the author of the attachment. | |
$this | footer(string $footer) Set the footer content. | |
$this | footerIcon(string $icon) Set the footer icon. | |
$this | timestamp(DateTimeInterface|DateInterval|int $timestamp) Set the timestamp. |
Details
protected int secondsUntil(DateTimeInterface|DateInterval|int $delay)
Get the number of seconds until the given DateTime.
protected int availableAt(DateTimeInterface|DateInterval|int $delay = 0)
Get the "available at" UNIX timestamp.
protected DateTimeInterface|int parseDateInterval(DateTimeInterface|DateInterval|int $delay)
If the given value is an interval, convert it to a DateTime instance.
protected int currentTime()
Get the current system time as a UNIX timestamp.
$this title(string $title, string|null $url = null)
Set the title of the attachment.
$this pretext(string $pretext)
Set the pretext of the attachment.
$this content(string $content)
Set the content (text) of the attachment.
$this fallback(string $fallback)
A plain-text summary of the attachment.
$this color(string $color)
Set the color of the attachment.
$this field(Closure|string $title, string $content = '')
Add a field to the attachment.
$this fields(array $fields)
Set the fields of the attachment.
$this markdown(array $fields)
Set the fields containing markdown.
$this image(string $url)
Set the image URL.
$this thumb(string $url)
Set the URL to the attachment thumbnail.
$this author(string $name, string|null $link = null, string|null $icon = null)
Set the author of the attachment.
$this footer(string $footer)
Set the footer content.
$this footerIcon(string $icon)
Set the footer icon.
$this timestamp(DateTimeInterface|DateInterval|int $timestamp)
Set the timestamp.
© Taylor Otwell
Licensed under the MIT License.
Laravel is a trademark of Taylor Otwell.
https://laravel.com/api/5.7/Illuminate/Notifications/Messages/SlackAttachment.html