title: How to retrieve uploaded file from a custom file system in Laravel?
body: <p>I have uploaded a file to my custom file system and it just works.</p>
  <p>Custom File System:</p>
  <pre><code>'private' =&gt; [
      'driver' =&gt; 'local',
      'root' =&gt; storage_path('app/private'),
  ],
  </code></pre>
  <p>This is how I upload my files:</p>
  <pre><code>if ($request-&gt;hasFile('chatattachment')) {
  
      $file = request()-&gt;file('chatattachment');
  
      $fname = date('YmdHis');
  
      $ext = $request-&gt;chatattachment-&gt;extension();
  
      $filename = $fname . '.' . $ext;
  
      $file-&gt;storeAs('attachments', $filename, ['disk' =&gt; 'private']);
  
  
      //Trying to get the url but it doest work:
      $url = Storage::url('private/attachments/' . $filename);
  }
  </code></pre>
  <p>Now, What I'm trying to do is to get the url of the newly uploaded image and return it back to the front end side. How to make it possible? I know how to create a storage:link but I don't want to expose this attachments to the public.</p>