Hello,
I need to let users access images only if they are authenticated.
So I don't create any public symlink.
I think that I have to create a controller and display the image from a route.
<img src="{{ route('media', ['path' => $user->avatar_thumb_url]) }}">
...
$path = base_path().$path;
return response()->file(storage_path($path));
But it doesn't work.
What's wrong with my code ?
Is there another way, perhaps simpler, to do the same ?
And something disturbs me : the full path to the image (/home/vincent/...) is visible in the source code, and I don't want the path to be visible. So I'd like to create to create either a sort of temporary link or a slug to access each image.
What do you suggest me ?
Thanks a lot ;).
Vincent