Show Image in InfoList
In infolist builder, we have an option to show image.
My issue is that I don't save the image on the database. I will use an image uploaded to the public folder with filename of the code column.
In normal blade, I'm going to render it with
How do I achieve this in InfoList card?
6 Replies
Yes I"m aware, but I don't upload the image using storage or something. The images are manuallya added to the public folders not storage.
@Vp I'm not sure how do I load the imagegs using
public_path() . '/images/product_images/' . $orderItem->variant->product->code . '.png'
I think you can use custom entry https://filamentphp.com/docs/3.x/infolists/entries/custom#view-entries
You can:
ViewEntry::make('status')
->view('blade file',$params)
Or
Placeholder::make('image')->hiddenLabel()
->content(new HtmlString('<img class="shadow-lg mx-auto rounded-md" src="' . $YOUR_URL. '">')),
@Ngannv I couldn't find Placeholder inside Infolist components.
Sorry!
please try this:
TextEntry::make('anything')->formatStateUsing(function(){
return new HtmlString("<img src='https://codezi.pro/assets/logo-v6.png'>");
})->hiddenLabel(),