In my project, I have implemented auth and ACL for my controllers and routes. I have a file upload system accessible only if the user is logged. It's work fine.
My problem is on the uploaded files. The user can access any file if have a file URL. How I can implement auth on uploaded files?
I tried with routes, but when accessing my file through the browser the file is shown as if not have a route intercepting this URL.
I have used this code:
Route::get('/storage/document/3/4a15c1ab060be8f35.png', function () {
return 'ok';
});
How can I implement auth on specific folders on storage? Thanks!
storage/app/public
. How i can make it for protect a subfolder ofpublic
likestorage/app/public/docs
? – Brownnose