App\Libraries\Skype\SkypeResponse::addAttachment PHP Method

addAttachment() public method

public addAttachment ( $attachment )
    public function addAttachment($attachment)
    {
        $this->attachments[] = $attachment;
    }

Usage Example

Example #1
0
 protected function createResponse($type, $content)
 {
     $response = new SkypeResponse($type);
     if (is_string($content)) {
         $response->setText($content);
     } else {
         if ($content instanceof \Illuminate\Database\Eloquent\Collection) {
             // do nothing
         } elseif (!is_array($content)) {
             $content = [$content];
         }
         foreach ($content as $item) {
             $response->addAttachment($item);
         }
     }
     return json_encode($response);
 }