src/Message.php
public function image($resource, $isReusable = false)
    {
        $payload = [
            'is_reusable' => $isReusable
        ];

        if (is_int($resource)) {
            $payload['attachment_id'] = $resource;
        } else {
            $payload['url'] = $resource;
        }

        $this->setAttachment('image', $payload);

        return $this;
    }
public function image($resource, $isReusable = false)
    {
        $payload = [
            'is_reusable' => $isReusable
        ];

        if (is_int($resource)) {
            $payload['attachment_id'] = $resource;
        } else {
            $payload['url'] = $resource;
        }

        $this->setAttachment('image', $payload);

        return $this;
    }
public function image ( $ resource , $ isReusable = false ) { $ payload = [ 'is_reusable' => $ isReusable ] ; if ( is_int ( $ resource ) ) { $ payload [ 'attachment_id' ] = $ resource ; } else { $ payload [ 'url' ] = $ resource ; } $ this -> setAttachment ( 'image' , $ payload ) ; return $ this ; }
Populate image

@param string|int $resource Url or attachment id
@param bool $isReusable Is reusable

@return Message
Populate image