Use non public folders :) You can return the file through a route if needed. https://laravel.com/docs/9.x/filesystem#downloading-files
Dec 7, 2022
4
Level 8
How to restrict access to folders after creating symlink to storage?
I am storing users uploaded files to app/storage/uploads/
I then created a symlink to public folder in order to be able to view them.
But how am I supposed to restrict access to only the users I want to when I use AJAX or Fetch API to get the files? Right now anyone can simply get the files via the URL because it's publicly available now that the symlink has been connected
I want only the user that uploaded the files (Or users who got permission) to be able to access these files.
What is the correct way to do that? What is the work flow
Please or to participate in this conversation.