PHP Class Spatie\SlashCommand\Attachment

Show file Open project: spatie/laravel-slack-slash-command Class Usage Examples

Protected Properties

Property Type Description
$authorIcon string Optional author icon for the attachment.
$authorLink string Optional author link for the attachment.
$authorName string Optional author name for the attachment.
$color string The color to use for the attachment.
$fallback string The fallback text to use for clients that don't support attachments.
$fields Illuminate\Support\Collection The fields of the attachment.
$footer string The text to use for the attachment footer.
$footerIcon string The icon to use for the attachment footer.
$imageUrl string Optional image that should appear within the attachment.
$preText string Optional text that should appear above the formatted data.
$text string Optional text that should appear within the attachment.
$thumbUrl string Optional thumbnail that should appear within the attachment.
$timestamp DateTime The timestamp to use for the attachment.
$title string Optional title for the attachment.
$titleLink string Optional title link for the attachment.

Public Methods

Method Description
__construct ( )
addField ( AttachmentField | array $field ) Add a field to the attachment.
addFields ( array $fields ) Add the fields for the attachment.
clearFields ( ) Clear all fields for this attachment.
create ( )
setAuthorIcon ( string $authorIcon ) Set the author icon to use for the attachment.
setAuthorLink ( string $authorLink ) Set the auhtor link to use for the attachment.
setAuthorName ( string $authorName ) Set the author name to use for the attachment.
setColor ( string $color ) Set the color to use for the attachment.
setFallback ( string $fallback ) Set the fallback text.
setFields ( array $fields ) Set the fields for the attachment.
setFooter ( string $footer ) Set the footer text to use for the attachment.
setFooterIcon ( string $footerIcon ) Set the footer icon to use for the attachment.
setImageUrl ( string $imageUrl ) Set the optional image to appear within the attachment.
setPreText ( string $preText ) Set the text that should appear above the formatted data.
setText ( string $text ) Set the optional text to appear within the attachment.
setThumbUrl ( string $thumbUrl ) Set the optional thumbnail to appear within the attachment.
setTimestamp ( DateTime $timestamp ) Set the timestamp to use for the attachment.
setTitle ( string $title ) Set the title to use for the attachment.
setTitleLink ( string $titleLink ) Set the title link to use for the attachment.
toArray ( ) : array Convert this attachment to its array representation.

Method Details

__construct() public method

public __construct ( )

addField() public method

Add a field to the attachment.
public addField ( AttachmentField | array $field )
$field AttachmentField | array

addFields() public method

Add the fields for the attachment.
public addFields ( array $fields )
$fields array

clearFields() public method

Clear all fields for this attachment.
public clearFields ( )

create() public static method

public static create ( )

setAuthorIcon() public method

Set the author icon to use for the attachment.
public setAuthorIcon ( string $authorIcon )
$authorIcon string

setAuthorName() public method

Set the author name to use for the attachment.
public setAuthorName ( string $authorName )
$authorName string

setColor() public method

Set the color to use for the attachment.
public setColor ( string $color )
$color string

setFallback() public method

Set the fallback text.
public setFallback ( string $fallback )
$fallback string

setFields() public method

Set the fields for the attachment.
public setFields ( array $fields )
$fields array

setFooter() public method

Set the footer text to use for the attachment.
public setFooter ( string $footer )
$footer string

setFooterIcon() public method

Set the footer icon to use for the attachment.
public setFooterIcon ( string $footerIcon )
$footerIcon string

setImageUrl() public method

Set the optional image to appear within the attachment.
public setImageUrl ( string $imageUrl )
$imageUrl string

setPreText() public method

Set the text that should appear above the formatted data.
public setPreText ( string $preText )
$preText string

setText() public method

Set the optional text to appear within the attachment.
public setText ( string $text )
$text string

setThumbUrl() public method

Set the optional thumbnail to appear within the attachment.
public setThumbUrl ( string $thumbUrl )
$thumbUrl string

setTimestamp() public method

Set the timestamp to use for the attachment.
public setTimestamp ( DateTime $timestamp )
$timestamp DateTime

setTitle() public method

Set the title to use for the attachment.
public setTitle ( string $title )
$title string

toArray() public method

Convert this attachment to its array representation.
public toArray ( ) : array
return array

Property Details

$authorIcon protected property

Optional author icon for the attachment.
protected string $authorIcon
return string

$authorName protected property

Optional author name for the attachment.
protected string $authorName
return string

$color protected property

The color to use for the attachment.
protected string $color
return string

$fallback protected property

The fallback text to use for clients that don't support attachments.
protected string $fallback
return string

$fields protected property

The fields of the attachment.
protected Collection,Illuminate\Support $fields
return Illuminate\Support\Collection

$footerIcon protected property

The icon to use for the attachment footer.
protected string $footerIcon
return string

$imageUrl protected property

Optional image that should appear within the attachment.
protected string $imageUrl
return string

$preText protected property

Optional text that should appear above the formatted data.
protected string $preText
return string

$text protected property

Optional text that should appear within the attachment.
protected string $text
return string

$thumbUrl protected property

Optional thumbnail that should appear within the attachment.
protected string $thumbUrl
return string

$timestamp protected property

The timestamp to use for the attachment.
protected DateTime $timestamp
return DateTime

$title protected property

Optional title for the attachment.
protected string $title
return string