title: Uploading to S3 with Laravel 5.2
body: <p>Having an issue with the s3 driver for Laravel 5.2. The error i'm getting is this: </p>
  
  <pre><code>Found 1 error while validating the input provided for the HeadObject operation:
  [Key] must be at least 1 characters long. Value provided is 0 characters long.
  </code></pre>
  
  <p>I'm using the league flysystem V3 as stated in Laravel docs. When I follow the stack track and start dumping out the vars the 'Key' value is always empty but i've set it all up in my config file.</p>
  
  <p>Here are the top lines from my stack trace</p>
  
  
  
  <pre><code>in Validator.php line 38
  at Validator-&gt;validate('HeadObject', object(StructureShape), array('Bucket' =&gt; 'monstervsl', 'Key' =&gt; '', '@http' =&gt; array())) in Middleware.php line 77
  at Middleware::Aws\{closure}(object(Command), null) in S3Client.php line 710
  at S3Client::Aws\S3\{closure}(object(Command), null) in S3Client.php line 729
  at S3Client::Aws\S3\{closure}(object(Command), null) in Middleware.php line 53
  at Middleware::Aws\{closure}(object(Command), null) in SSECMiddleware.php line 59
  at SSECMiddleware-&gt;__invoke(object(Command)) in AwsClient.php line 208
  </code></pre>
  
  <p>As you can see it's getting the bucket from my config but not the key it's empty.</p>
  
  <p>Here is my <code>filesystem.php</code> file</p>
  
  
  
  <pre><code>        's3' =&gt; [
              'driver' =&gt; 's3',
  //            'key'    =&gt; env('S3_KEY'),
  //            'secret' =&gt; env('S3_SECRET'),
              'key' =&gt; '8tfnxo8abgn7voaex8rgv', // &lt;- Not my real key 
              'secret' =&gt; 'aw7btx49wXNF7AGWV', //  &lt;- not my real secret
              'region' =&gt; 'eu-west-1',
              'bucket' =&gt; 'monstervsl',
          ],
  </code></pre>
  
  <p>Here is my controller, it's fairly straight forward, I don't think the put contents stuff is relevant but added it anyway</p>
  
  
  
  <pre><code>// Write the contents to a new file on disk
  $view = view('iframe')-&gt;with('json', $video-&gt;toJson());
  $contents = $view-&gt;render();
  $token = '12345';
  $filePath = public_path() .'/iframes/' . $token . '.html';
  file_put_contents($filePath, $contents);
  
  Storage::disk('s3')-&gt;put('/', file_get_contents($filePath));
  </code></pre>