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
<img height="65"
src="{{ public_path() . '/images/product_images/' . $orderItem->variant->product->code . '.png' }}"
class="" />
<img height="65"
src="{{ public_path() . '/images/product_images/' . $orderItem->variant->product->code . '.png' }}"
class="" />
How do I achieve this in InfoList card?
6 Replies
Bagus A
Bagus A6mo ago
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'
Ngannv
Ngannv6mo ago
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. '">')),
Bagus A
Bagus A6mo ago
@Ngannv I couldn't find Placeholder inside Infolist components.
Ngannv
Ngannv6mo ago
Sorry! please try this: TextEntry::make('anything')->formatStateUsing(function(){ return new HtmlString("<img src='https://codezi.pro/assets/logo-v6.png'>"); })->hiddenLabel(),