/** * @param PhotoThumb $thumb * @param Photo $photo * @return null|PhotoFile */ public function uploadThumb(PhotoThumb $thumb, Photo $photo) { $this->s3->putObject(['Bucket' => $this->config->bucket(), 'Key' => $this->getThumbUri($photo->id(), $photo->slug(), $thumb->width(), $thumb->height(), $thumb->photoThumbFile()->format()), 'Body' => fopen($thumb->photoThumbFile()->filePath(), 'r'), 'ContentType' => $thumb->photoThumbFile()->mimeType(), 'ACL' => 'public-read']); }