F
Filamentβ€’12mo ago
leoPascal

Is it possible to generate barcode in filament?

Hello, I have to generate a barcode for a given number and I tried with milon/barcode for laravel like this but it gives 'div' as whole html tag.
TextColumn::make('supplier_barcode')->formatStateUsing(function ($record) {
$barcode = DNS1D::getBarcodeHTML($record->supplier_barcode, 'PHARMA');
return $barcode;
}),
TextColumn::make('supplier_barcode')->formatStateUsing(function ($record) {
$barcode = DNS1D::getBarcodeHTML($record->supplier_barcode, 'PHARMA');
return $barcode;
}),
Thank you.
Solution:
you can add ->html()
Jump to solution
7 Replies
Solution
Lara Zeus
Lara Zeusβ€’12mo ago
you can add ->html()
leoPascal
leoPascalOPβ€’12mo ago
wow! thank you so much & GOD bless you @Lara Zeus . it works like a charm.
leoPascal
leoPascalOPβ€’12mo ago
sorry, but how can I display the number at the bottom of this barcode?
Lara Zeus
Lara Zeusβ€’12mo ago
try this return $barcode."<br>".$record->supplier_barcode; you can customize it as you like since this is just an html πŸ™‚
leoPascal
leoPascalOPβ€’12mo ago
superb! πŸ‘
Lara Zeus
Lara Zeusβ€’12mo ago
if you need to use more markup I recomend to use a view column instead
leoPascal
leoPascalOPβ€’12mo ago
really, I never checked that. I will definetly give it a try. Thank you so very much once again for your kind assistance.
Want results from more Discord servers?
Add your server