srjrol
How to use private local storage with ImageEntry
I found a similar question/answer https://discord.com/channels/883083792112300104/1145723690839973908 but it's not working for me.
@CodeWithDennis Do you have any suggestions for what I could be missing here? Thanks The documentation says "The entry must contain the path to the image, relative to the root directory of its storage disk, or an absolute URL to it." and I've stored the images in my providers
@CodeWithDennis Do you have any suggestions for what I could be missing here? Thanks The documentation says "The entry must contain the path to the image, relative to the root directory of its storage disk, or an absolute URL to it." and I've stored the images in my providers
image_url
column with the relative path like provider-images/01HWX.jpg
In my AppServiceProvider.php
I am using buildTemporaryUrlsUsing
as instructed:
In my ViewProvider.php
the ImageEntry->url()
works as expected and I can see the image if I visit that URL directly but the image is still not loading from the image_url
column in my database
EditProvider.php
is correctly storing images in /storage/app/private/provider-images/
web.php
(using ->where('path', '.*')
as @CodeWithDennis suggested.
In the logs I can see the URL is generated as I expect but the image fails to load because it's trying from https://mydomain.com/storage/provider-images/01HWX.jpg
instead of the ->url()
path like https://mydomain.com/private/temp/provider-images/01HWXQR459X1ABFQTHPQV9DACQ.jpg?expires=1714749092&signature=73a61b...
5 replies