Filament Checkboxlist returns raw HTML
Im trying to make a dynamic checkboxlist. For each checkbox, i want to show an Font-Awesome icon.
The issue is, that it just renders as a regular string.
Any idea how to solve that?
Tab::make('Faciliteter')
->schema([
Grid::make(1)
->schema([
CheckboxList::make('facilities')
->relationship('facilities', 'facility_name')
->getOptionLabelFromRecordUsing(function ($record) {
return new HtmlString('<i class="fa fa-' . $record->facility_fa_icon . '"></i> ' . $record->facility_name);
})
->columns(5),
]),
]),
4 Replies
No one with an idea? π
The label probably doesn't support HtmlString and expects a string. You could create a PR to add support.
Thx @Dennis Koch - I will try to see if i can figure out making the change.
It's probably just the expected type of the property and return type of the methods that is set to
string