F
Filamentβ€’14mo ago
KingNii

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 Kochβ€’14mo 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
KingNiiβ€’14mo 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
awcodesβ€’14mo ago
Did you run storage:link
KingNii
KingNiiβ€’14mo ago
@awcodes Yes sir. I can access image from public directory but It's just not displaying within the table build.
awcodes
awcodesβ€’14mo ago
What console errors are you seeing for the image in the browser?
KingNii
KingNiiβ€’14mo 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
awcodesβ€’14mo 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
KingNiiβ€’14mo 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
awcodesβ€’14mo ago
it's an .env file, you'll have to change it anyway. πŸ‘