Skip to content

Instantly share code, notes, and snippets.

@blenderdeluxe
Created September 1, 2021 03:06
Show Gist options
  • Select an option

  • Save blenderdeluxe/a79038ba46c6d11473fdc2a3ebeda0d5 to your computer and use it in GitHub Desktop.

Select an option

Save blenderdeluxe/a79038ba46c6d11473fdc2a3ebeda0d5 to your computer and use it in GitHub Desktop.
$image_storage = '';
$newImage->resize(800, null, function ($constraint) {
$constraint->aspectRatio();
})->encode('jpg', 90);
//Guardo nueva imagen grande
Storage::disk('s3')->getDriver()->getAdapter()->getClient()->putObject(array(
'Bucket' => config('filesystems.disks.s3.bucket'),
'Key' => $image_storage . $name . '.jpg',
'Body' => $newImage->__toString(),
'ACL' => 'public-read',
'ContentType' => "image/jpg",
'Expires' => Carbon::now('America/Santiago')->addYears(5),
'CacheControl' => 'max-age',
));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment