protected function getAttachmentPayload($text = null, $title = null, $images = null, $color = null)
    {
        $attachment = [];

        if ($text) {
            $attachment['text'] = $this->stringValue($text);
        }

        if ($title) {
            $attachment['title'] = $this->stringValue($title);
        }

        if ($images = $this->getImagesPayload($images)) {
            $attachment['images'] = $images;
        }

        if ($color) {
            $attachment['color'] = (string) $color;
        }

        return $attachment;
    }
protected function getAttachmentPayload($text = null, $title = null, $images = null, $color = null)
    {
        $attachment = [];

        if ($text) {
            $attachment['text'] = $this->stringValue($text);
        }

        if ($title) {
            $attachment['title'] = $this->stringValue($title);
        }

        if ($images = $this->getImagesPayload($images)) {
            $attachment['images'] = $images;
        }

        if ($color) {
            $attachment['color'] = (string) $color;
        }

        return $attachment;
    }
protected function getAttachmentPayload ( $ text = null , $ title = null , $ images = null , $ color = null ) { $ attachment = [ ] ; if ( $ text ) { $ attachment [ 'text' ] = $ this -> stringValue ( $ text ) ; } if ( $ title ) { $ attachment [ 'title' ] = $ this -> stringValue ( $ title ) ; } if ( $ images = $ this -> getImagesPayload ( $ images ) ) { $ attachment [ 'images' ] = $ images ; } if ( $ color ) { $ attachment [ 'color' ] = ( string ) $ color ; } return $ attachment ; }
Get payload for an attachment.

@param  mixed  $text
@param  mixed  $title
@param  mixed  $images
@param  mixed  $color
@return array
Get payload for an attachment .