title: How to download a file from URL without showing the full path in laravel?
body: <p>Download link:-</p>
  <pre><code> &lt;a  href='&quot;+ downloadlink + '/attachment-download/' + $('#employee_ID').val()+'/'+ res[i].file_name +&quot;'&gt;    
  </code></pre>
  <p>Route:-</p>
  <pre><code>Route::get('/attachment-download/{id}/{filename}', array(
   'uses' =&gt; 'AttachmentsController@getDownloadAttachments'
  ));
  </code></pre>
  <p>Attachment Controller:-</p>
  <pre><code>public function getDownloadAttachments($id,$filename){
      $file=&quot;./img/user-icon.png&quot;;
  
      $resource = \Employee::WhereCompany()-&gt;findOrfail($id);
  
      $path = $this-&gt;attachmentsList($resource);
  
      foreach($path as $index =&gt; $attachment){
          if ($filename == $attachment['file_name']) {
          $filePath = $attachment['url'];
          }
      }
      //return \Response::download($file);
      return \Response::download($filePath);
  }
  
  
  File URL Output:-
  https://zetpayroll.s3.ap-south-1.amazonaws.com/employees/81/Screenshot%20from%202017-04-26%2015%3A07%3A45.png?X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&amp;X-Amz-Algorithm=AWS4-HMAC-SHA256&amp;X-Amz-Credential=AKIAI57OFN3HPCBPQZIQ%2F20170612%2Fap-south-1%2Fs3%2Faws4_request&amp;X-Amz-Date=20170612T144818Z&amp;X-Amz-SignedHeaders=host&amp;X-Amz-Expires=3600&amp;X-Amz-Signature=59ecc4d11b7ed71bd336531bd7f4ab7c84da6b7424878d6487679c97a8c52ca7
  </code></pre>
  <p>In this, if try to download the file by using a static path like</p>
  <pre><code> $file=&quot;./img/user-icon.png&quot;;  
   return \Response::download($file);
  </code></pre>
  <p>it is downloaded fine. But not possible to downloading file from AWS URL, Please help me how to down file automatically using URL. Or How to get Path from URL in laravel or PHP.
  Thank you.</p>