title: Laravel Storage for Amazon S3 'put' method uses wrong URL
body: <p>I am developing an app using Laravel 5.7 and currently trying to implement image storage using Amazon S3. I am using the <code>league/flysystem-aws-s3-v3</code> package with Laravel's built in Storage facade. When I try to upload an image, the <code>Storage-&gt;put()</code> command is generating the wrong URL. </p>
  
  <p>I have followed multiple tutorials and docs online and all of them just use the following command </p>
  
  <pre><code>Storage::disk('s3')-&gt;put('{file_name}', '{file_content}')
  </code></pre>
  
  <p>and the file_name is automatically prefixed with the amazon s3 url; however, for me this is not the case. But if I hardcode in the <code>AWS_URL</code>, everything works fine. I have all the correct values set up in the .env file (I believe) but Laravel seems to not be getting the <code>AWS_URL</code> correctly. </p>
  
  <p>I have tried it with and without quotes around the env values. I have also ran</p>
  
  <pre><code>php artisan config:cache
  php artisan cache:clear
  </code></pre>
  
  <p>to clear the env variables' cache.</p>
  
  <p>.env</p>
  
  <pre><code>AWS_ACCESS_KEY_ID="**************"
  AWS_SECRET_ACCESS_KEY="****************"
  AWS_DEFAULT_REGION="us-east-1"
  AWS_BUCKET="*****"
  AWS_URL=http://******.s3.us-east-1.amazonaws.com
  </code></pre>
  
  <p>filesystems.php</p>
  
  <pre><code>'s3' =&gt; [
          'driver' =&gt; 's3',
          'key' =&gt; env('AWS_ACCESS_KEY_ID'),
          'secret' =&gt; env('AWS_SECRET_ACCESS_KEY'),
          'region' =&gt; env('AWS_DEFAULT_REGION'),
          'bucket' =&gt; env('AWS_BUCKET'),
          'url' =&gt; env('AWS_URL'),
      ],
  </code></pre>
  
  <p>Using <code>php artisan tinker</code>: </p>
  
  <p>This uploads the file properly, but I shouldn't need to hard code the url.</p>
  
  <pre><code>&gt;&gt;&gt; Storage::disk('s3')-&gt;put('snoflow.s3.us-east-1.amazonaws.com/Hello.txt', 'Hello World!');
  =&gt; true`
  </code></pre>
  
  <p>This is how the command should be called but is giving an error. Notice the attempted Url is only the filename.</p>
  
  <pre><code>&gt;&gt;&gt; Storage::disk('s3')-&gt;put('Hello.txt', 'Hello World!');
  =&gt; Aws/S3/Exception/S3Exception with message 'Error executing "PutObject" on "https://filename.txt"; AWS HTTP error: cURL error 6: Could not resolve host: filename.txt (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)'`
  </code></pre>
  
  <p>Any help would be appreciated.</p>