Created
September 1, 2021 03:06
-
-
Save blenderdeluxe/a79038ba46c6d11473fdc2a3ebeda0d5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $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