1$file = request()->file('my_input_file_name');
2
3$imageName = $file->getClientOriginalName();
4
5$img = Image::make($file);
6
7$img->resize(null, 1000, function ($constraint) {
8 $constraint->aspectRatio();
9});
10
11//detach method is the key! Hours to find it... :/
12$resource = $img->stream()->detach();
13
14$path = Storage::disk('s3')->put(
15 'my-s3-folder/' . $imageName,
16 $resource
17);