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
Dennis Koch
Dennis Koch2y ago
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).
KingNii
KingNiiOP2y ago
@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.
awcodes
awcodes2y ago
Did you run storage:link
KingNii
KingNiiOP2y ago
@awcodes Yes sir. I can access image from public directory but It's just not displaying within the table build.
awcodes
awcodes2y ago
What console errors are you seeing for the image in the browser?
KingNii
KingNiiOP2y ago
@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
awcodes
awcodes2y ago
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.
KingNii
KingNiiOP2y ago
@awcodes made the changes and images are displaying. Just have to remember to change it back before deploying it. @Dennis Koch @awcodes Thank you.
awcodes
awcodes2y ago
it's an .env file, you'll have to change it anyway. 👍

Did you find this page helpful?