status = true; if ($request->includeAttachments === true) { if ($request->hasAttachments() === true) { $attachments = []; foreach ($request->attachmentCollection->attachments as $attachment) { $attachments[] = new Attachment($attachment->fileName, $attachment->contentType, $attachment->content); } $response->attachmentCollection = new AttachmentCollection($attachments); } } return $response; } }