select items render html
I want to add color to select items i have make this but it displays the css as text and the html() is not define for select this is my code. Any Ideas??
Select::make('leads_status_id')
->label(__('labels.status'))
->relationship('status', 'name', fn ($query) => $query->orderBy('sort_order'))
->preload()
->options(function () {
return LeadsStatus::all()->mapWithKeys(function ($status) {
return [
$status->id => "<span style='color: {$status->color};'>{$status->name}</span>",
];
})->toArray();
})
->searchable()
->required(),
0 Replies