© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•15mo ago
Majd

Set default MorphTo relationships in Form Builder

How for MorphTo relationships in Form Builder add default value on first step when choose MorphToSelect\Type?

I need when I press button "New record" and open create page '/admin/comments/create', already default value choose on first step (see image 1)

I need something like this:

MorphToSelect::make('commentable')
->types([
MorphToSelect\Type::make(Product::class)
->titleAttribute('name'),
MorphToSelect\Type::make(Post::class)
->titleAttribute('title'),
])
->default(Product::class)
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

set toggle default value in form builder
FilamentFFilament / ❓┊help
3y ago
Managing Relationships in the Form Builder
FilamentFFilament / ❓┊help
3y ago
Form Builder support for polymorphic relationships
FilamentFFilament / ❓┊help
2y ago
Form relationships
FilamentFFilament / ❓┊help
2y ago