Work with private images

I am developing an admin panel for a little store so they can manage their stock, sells, etc. I need to allow them to upload images for categories and products but I don't want them to be public, so I am saving them inside storage/app/product-categories for example. Now the problem is I want to show that image in a table or to preview it on the form but there is no public url to do so. My idea was to create a specific route to handle this so only logged in users can see the image but I couldn't find a way to modify the src attribute of the image in the Table Builder. Does anyone know how to do this or am I force to have them stored inside the public folder? What if I need to store sensitive images?
Solution:
I will answer myself: 1. I have created a new route to handle image downloads for product categories. 2. Used Tables\Columns\ViewColumn to load a custom blade view. 3. In that custom blade view all I have is a img tag pointing to the url I just created....
Jump to solution
1 Reply
Solution
Abel Cobreros
Abel Cobreros8mo ago
I will answer myself: 1. I have created a new route to handle image downloads for product categories. 2. Used Tables\Columns\ViewColumn to load a custom blade view. 3. In that custom blade view all I have is a img tag pointing to the url I just created. Done!