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

Instantiate a new payload.

  • param array $attributes
public addField( $field)
 

Add a field to the block.

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

Clear the fields for the block/attachment.

  • return $this
public static Maknz\Slack\Block::factory(array $attributes)
 

Create a Block element from a keyed array of attributes.

  • param array $attributes
  • return \Block
  • throws \InvalidArgumentException
public getAccessory()
 

Get the section accessory.

  • return \Maknz\Slack\BlockElement
public Maknz\Slack\Block::getBlockId()
 

Get the block identifier.

  • return string
public getFields()
 

Get the fields for the block/attachment.

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

Get the section text.

  • return \Maknz\Slack\BlockElement\Text
public Maknz\Slack\Block::getType()
 

Get the block type.

  • return string
public setAccessory( $accessory)
 

Set the section accessory.

  • param mixed $accessory
  • return $this
  • throws \InvalidArgumentException
public Maknz\Slack\Block::setBlockId( $blockId)
 

Set the block identifier.

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

Set the fields for the block/attachment.

  • param array $fields
  • return $this
  • throws \InvalidArgumentException
public setText( $text)
 

Set the section text.

  • param mixed $text
  • return $this
  • throws \InvalidArgumentException
public toArray()
 

Convert the block to its array representation.

  • return array
Properties
protected $accessory = NULL
 

Block element to be included in the section.

  • var \Maknz\Slack\BlockElement
protected static $availableAttributes = ['text' => 'text', 'block_id' => 'block_id', 'fields' => 'fields', 'accessory' => 'accessory']
 

Internal attribute to property map.

  • var array
protected Maknz\Slack\Block::$block_id = NULL
 

Block identifier.

  • var string
protected $fields = []
 

Fields to appear in the section.

  • var \Maknz\Slack\BlockElement\Text[]
protected $text = NULL
 

The text for the section.

  • var \Maknz\Slack\BlockElement\Text
protected $type = 'section'
 

Block type.

  • var string
Methods
protected Maknz\Slack\Payload::fillProperties(array $attributes) : self
 
  • param array $attributes
  • return $this
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 = ['text' => 'text', 'block_id' => 'block_id', 'fields' => 'fields', 'accessory' => 'accessory']
 

Internal attribute to property map.

  • var array
Methods
public static Maknz\Slack\Block::factory(array $attributes)
 

Create a Block element from a keyed array of attributes.

  • param array $attributes
  • return \Block
  • throws \InvalidArgumentException
© 2025 Bruce Wells
Search Namespaces \ Classes
Configuration