Copied!
CloneableInstantiable
Methods
public Maknz\Slack\Payload::__construct(array $attributes)
 

Instantiate a new payload.

  • param array $attributes
public addAction( $action)
 

Add an action to the attachment.

  • param mixed $action
  • return $this
  • throws \InvalidArgumentException
public addField( $field)
 

Add a field to the block/attachment.

  • param \Field|array $field
  • return $this
  • throws \InvalidArgumentException
public clearActions()
 

Clear the actions for the attachment.

  • return $this
public clearFields()
 

Clear the fields for the block/attachment.

  • return $this
public getActions()
 

Get the collection of actions (buttons) to include in the attachment.

  • return \AttachmentAction[]
public getAuthorIcon()
 

Get the author icon to use for the attachment.

  • return string
public getAuthorLink()
 

Get the author link to use for the attachment.

  • return string
public getAuthorName()
 

Get the author name to use for the attachment.

  • return string
public getCallbackId()
 

Get the callback id for use with interactivity.

  • return string
public getColor()
 

Get the color to use for the attachment.

  • return string
public getFallback()
 

Get the fallback text.

  • return string
public getFields()
 

Get the fields for the block/attachment.

  • return \Maknz\Slack\Field[]|array
public getFooter()
 

Get the footer to use for the attachment.

  • return string
public getFooterIcon()
 

Get the footer icon to use for the attachment.

  • return string
public getImageUrl()
 

Get the optional image to appear within the attachment.

  • return string
public getMarkdownFields()
 

Get the fields Slack should interpret in its Markdown-like language.

  • return array
public getPretext()
 

Get the text that should appear above the formatted data.

  • return string
public getText()
 

Get the optional text to appear within the attachment.

  • return string
public getThumbUrl()
 

Get the optional thumbnail to appear within the attachment.

  • return string
public getTimestamp()
 

Get the timestamp to use for the attachment.

  • return \DateTime
public getTitle()
 

Get the title to use for the attachment.

  • return string
public getTitleLink()
 

Get the title link to use for the attachment.

  • return string
public setActions( $actions)
 

Set the collection of actions (buttons) to include in the attachment.

  • param array $actions
  • return \Attachment
  • throws \InvalidArgumentException
public setAuthorIcon( $author_icon)
 

Set the author icon to use for the attachment.

  • param string $author_icon
  • return $this
public setAuthorLink( $author_link)
 

Set the author link to use for the attachment.

  • param string $author_link
  • return $this
public setAuthorName( $author_name)
 

Set the author name to use for the attachment.

  • param string $author_name
  • return $this
public setCallbackId( $callback_id)
 

Set the callback id to use with interactivity.

  • param string $callback_id
  • return $this
public setColor( $color)
 

Set the color to use for the attachment.

  • param string $color
  • return $this
public setFallback( $fallback)
 

Set the fallback text.

  • param string $fallback
  • return $this
public setFields(array $fields)
 

Set the fields for the block/attachment.

  • param array $fields
  • return $this
  • throws \InvalidArgumentException
public setFooter( $footer)
 

Set the footer text to use for the attachment.

  • param string $footer
  • return $this
public setFooterIcon( $footerIcon)
 

Set the footer icon to use for the attachment.

  • param string $footerIcon
  • return $this
public setImageUrl( $image_url)
 

Set the optional image to appear within the attachment.

  • param string $image_url
  • return $this
public setMarkdownFields(array $fields)
 

Set the fields Slack should interpret in its Markdown-like language.

  • param array $fields
  • return $this
public setPretext( $pretext)
 

Set the text that should appear above the formatted data.

  • param string $pretext
  • return $this
public setText( $text)
 

Set the optional text to appear within the attachment.

  • param string $text
  • return $this
public setThumbUrl( $thumb_url)
 

Set the optional thumbnail to appear within the attachment.

  • param string $thumb_url
  • return $this
public setTimestamp( $timestamp)
 

Set the timestamp to use for the attachment.

  • param \DateTime $timestamp
  • return $this
public setTitle( $title)
 

Set the title to use for the attachment.

  • param string $title
  • return $this
public setTitleLink( $title_link)
 

Set the title link to use for the attachment.

  • param string $title_link
  • return $this
public toArray()
 

Convert this attachment to its array representation.

  • return array
Properties
protected $actions = []
 

A collection of actions (buttons) to include in the attachment.

A maximum of 5 actions may be provided.

  • var array
protected $author_icon = NULL
 

Optional author icon for the attachment.

  • var string
protected $author_link = NULL
 

Optional author link for the attachment.

  • var string
protected $author_name = NULL
 

Optional author name for the attachment.

  • var string
protected static $availableAttributes = ['fallback' => 'fallback', 'text' => 'text', 'image_url' => 'image_url', 'thumb_url' => 'thumb_url', 'pretext' => 'pretext', 'color' => 'color', 'footer' => 'footer', 'footer_icon' => 'footer_icon', 'timestamp' => 'timestamp', 'fields' => 'fields', 'mrkdwn_in' => 'markdown_fields', 'title' => 'title', 'title_link' => 'title_link', 'author_name' => 'author_name', 'author_link' => 'author_link', 'author_icon' => 'author_icon', 'callback_id' => 'callback_id', 'actions' => 'actions']
 

Internal attribute to property map.

  • var array
protected $callback_id = NULL
 

Optional provide callback_id used to provide interactivity callback information on the request.

  • var string
protected $color = 'good'
 

The color to use for the attachment.

  • var string
protected $fallback = NULL
 

The fallback text to use for clients that don't support attachments.

  • var string
protected $fields = []
 

The fields of the block/attachment.

  • var array
protected $footer = NULL
 

The text to use for the attachment footer.

  • var string
protected $footer_icon = NULL
 

The icon to use for the attachment footer.

  • var string
protected $image_url = NULL
 

Optional image that should appear within the attachment.

  • var string
protected $markdown_fields = []
 

The fields of the attachment that Slack should interpret with its Markdown-like language.

  • var array
protected $pretext = NULL
 

Optional text that should appear above the formatted data.

  • var string
protected $text = NULL
 

Optional text that should appear within the attachment.

  • var string
protected $thumb_url = NULL
 

Optional thumbnail that should appear within the attachment.

  • var string
protected $timestamp = NULL
 

The timestamp to use for the attachment.

  • var \DateTime
protected $title = NULL
 

Optional title for the attachment.

  • var string
protected $title_link = NULL
 

Optional title link for the attachment.

  • var string
Methods
protected Maknz\Slack\Payload::fillProperties(array $attributes) : self
 
  • param array $attributes
  • return $this
protected getActionsAsArrays()
 

Iterates over all actions in this attachment and returns them in their array form.

  • return array
protected getFieldClass()
 

Get the class name of valid fields.

  • return string
protected getFieldsAsArrays()
 

Iterates over all fields in this block/attachment and returns them in their array form.

  • return array
Properties
protected static $availableAttributes = ['fallback' => 'fallback', 'text' => 'text', 'image_url' => 'image_url', 'thumb_url' => 'thumb_url', 'pretext' => 'pretext', 'color' => 'color', 'footer' => 'footer', 'footer_icon' => 'footer_icon', 'timestamp' => 'timestamp', 'fields' => 'fields', 'mrkdwn_in' => 'markdown_fields', 'title' => 'title', 'title_link' => 'title_link', 'author_name' => 'author_name', 'author_link' => 'author_link', 'author_icon' => 'author_icon', 'callback_id' => 'callback_id', 'actions' => 'actions']
 

Internal attribute to property map.

  • var array
© 2024 Bruce Wells
Search Namespaces \ Classes
Configuration