title: League/Flysystem fstat() expects parameter 1 to be resource, object given
body: <p>I am in the process of upgrading a project from Laravel 5 to 5.1. One package that needed to be updated was <code>League\Flysystem</code>.</p>
  
  <p>I am using <code>Intervention\Image</code> to resize an image and then Flysystem to save it to S3. The code below was working with 5.0 -</p>
  
  <pre><code>// Album ID
  $id = $request-&gt;input('id');
  // Filename for this photo
  $filename = str_random() . ".jpg";
  
  // Get the storage disk
  $disk = Storage::disk('s3');
  
  // Resize the photo
  $image = Image::make($request-&gt;file('photo'));
  $image-&gt;orientate();
  $image-&gt;resize(1024, 748, function ($constraint) {
              $constraint-&gt;aspectRatio();
  });
  $image-&gt;encode('jpg');
  // Save the photo to the disk
  $disk-&gt;put("img/album/$id/$filename", $image);
  </code></pre>
  
  <p>But now I am receiving the following error: 
  <code>fstat() expects parameter 1 to be resource, object given</code>, thrown in <code>league\flysystem\src\Util.php</code>, line 250.</p>
  
  <p>I am using <code>"intervention/image": "~2.1"</code>, <code>"league/flysystem-aws-s3-v3" : "~1.0",</code></p>
  
  <p>Any ideas what might be causing this?</p>