danielcoimbra

My working code is:

$file = request()->file('my_input_file_name');

$imageName = $file->getClientOriginalName();

$img = Image::make($file);

$img->resize(null, 1000, function ($constraint) {
    $constraint->aspectRatio();
});

//detach method is the key! Hours to find it... :/
$resource = $img->stream()->detach();

$path = Storage::disk('s3')->put(
    'my-s3-folder/' . $imageName,
    $resource
);

Return to Thread...