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;
    }