title: Laravel - Protect image folder from web access
body: <p>I am doing upload image functionality in my project. Here I am saving my files in public folder  (public/img/myfiles/). I want to restrict the file access, if admin user is not logged in. (ie)</p>
  
  <p>If i put the URL like</p>
  
  <pre><code>https://domain/img/myfiles/filename.jpg
  </code></pre>
  
  <p>It should redirect to login page</p>
  
  <pre><code>https://domain/login
  </code></pre>
  
  <p>How to do that? and I don't want to restrict particular image to associated user. As the user is admin, I want to give them full access to image folder.</p>