© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3y ago
Juan Duarte Molina

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');
}),
]),
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

MorphToSelect with createOptionForm
FilamentFFilament / ❓┊help
3y ago
MorphToSelect with one type
FilamentFFilament / ❓┊help
3y ago
Issue: MorphToSelect with Translated Titles
FilamentFFilament / ❓┊help
2y ago
Unique rule with MorphToSelect fields
FilamentFFilament / ❓┊help
3y ago