ImageColumn not displaying in Table builder
I created a listing data with an image and I'm using the Table builder to create a table for my listing. The problem is that all other data columns are displaying except for the image. When I output the image without the Table builder by using Storage::URL($image), the image display but when I use the ImageColumn::make('image'), the image is displayed. This is how I saved the image FileUpload::make('image')
->image()
->preserveFilenames()
->directory('listing')
->hint('Main Image')
->columnSpan('full')
->required(),
9 Replies
Anything special on the image column? If it's not rendering it usually cannot find the image (there are some checks inside the column logic).
@Dennis Koch Nothing special, this is the filepath in DB listing/kw76.png. I don't why It can't find the image but when I display it in the blade with Storage::URL() it display the image.
Did you run storage:link
@awcodes Yes sir. I can access image from public directory but It's just not displaying within the table build.
What console errors are you seeing for the image in the browser?
@awcodes I'm not getting any console errors but looking at the network tab, I think the issue is coming from my APP_URL. I'm using localhost but the network is trying to fetch the app url from http://project-saas.test
yep. assets don't play well with localhost. either use your app url from .env or change it to localhost with the right port number.
@awcodes made the changes and images are displaying. Just have to remember to change it back before deploying it.
@Dennis Koch @awcodes Thank you.
it's an .env file, you'll have to change it anyway. π