SlackAttachment
class SlackAttachment (View source)
Traits
Properties
string | $title | The attachment's title. |
|
string | $url | The attachment's URL. |
|
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
Get the number of seconds until the given DateTime.
If the given value is an interval, convert it to a DateTime instance.
Set the title of the attachment.
Set the content (text) of the attachment.
A plain-text summary of the attachment.
Set the color of the attachment.
Set the fields of the attachment.
Set the fields containing markdown.
Set the image URL.
Set the URL to the attachment thumbnail.
Set the author of the attachment.
Set the footer content.
Set the footer icon.
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
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.