MorphToSelect with allowHtml

Hello there

I'm trying to use MorphToSelect & allowHtml.. but not working

When I put allowHtml in the "main" MorphToSelect there is no result and the options appear as "<div><span> ...."

When I try to put the allowHtml in the MorphToSelect into Types trow me an error : "Call to undefined method Filament\Forms\Components\MorphToSelect\Type::allowHtml()"

Thanks

My code :

Forms\Components\MorphToSelect::make('Originable')->label('Lot Entrada')
->types([
Forms\Components\MorphToSelect\Type::make(ProviderBatch::class)->titleColumnName('code')->label('Proveïdors')
->modifyOptionsQueryUsing(function(Builder $query, Closure $get) {
return $get('variety_id') ? $query->where('variety_id',$get('variety_id')) : $query->whereNull('variety_id');
}),

Forms\Components\MorphToSelect\Type::make(ProductionBatch::class)->titleColumnName('code')->label('Generat') ->allowHtml()
->getOptionLabelFromRecordUsing(fn (ProductionBatch $record): string =>
view('filament.components.select-production-batch') ->with('code', $record?->name) ->render()
)
->modifyOptionsQueryUsing(function(Builder $query, Closure $get) {
return $get('variety_id') ? $query->where('variety_id',$get('variety_id')) : $query->whereNull('variety_id');
}),
]),
Was this page helpful?