Image not showing in filament php
I created a storage link and am able to view the image using localhost:8000/storage/children/image_name
17 Replies
I think I've told you this multiple times already: You need to provide some information, otherwise nobody can help. We can look into your computer 🤷
okay then let me provide as much information as needed
First I upload the images using the code below
in the above code I store the child image in the directory called children and the image is stored perfectly fine
The challenge is at the point of retrieving the image and during the editting
These are the columns where the image should be displayed but nothing is displayed
On the dashboard this is what I have
Do you have a disk "children"? Why are you using it for the table, but not for the form?
Can you check the network tab and console of DevTools?
I added that disk called children
checking the network tab it seems it only tries to load the actually image name only without considering children directory
I have realized there is also a cors error
it considers localhost/storage yet it should be localhost:8000/storage
Check your
APP_URL
. It doesn't match the domain you are usingI have updated it now
same cors error though thats a right path now
do you think they are permissions
localhost:8000 is trying to fetch from 127.0.0.1
why is that?
what do you have in your .env file ? app_url
If i want images to be displayed, i have to setup a VHOST so i can do something as domain.local , filament doesnt add the port number when i run php artisan serve
You should be accessing it over 127.0.0.1 not localhost since how you are loading laravel in your dev enviroment
It's nothing to do with filament, but how Laravel is serving itself.
really you should use herd, valet, laragon etc not ports of :8000
okay thank you well noted
So, that's fixed?
am going to try on a live domain