© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3y ago•
6 replies
Robin

Morphed table not filling in form

I don't seem to be able to fill the value of a morphed column in the formview.

I have the following relation;

public function sellingPoint(): MorphOne
{
    return $this->morphOne(SellingPoint::class, 'morph');
}
public function sellingPoint(): MorphOne
{
    return $this->morphOne(SellingPoint::class, 'morph');
}


When I try to access this inside a form, it never gets filled with a value. I try to access ti this way;

 Forms\Components\TextInput::make('sellingPoint.name')
     ->reactive()
     ->afterStateUpdated(function (?VendingMachine $record, $state) {
         $record?->sellingPoint?->update([
             'name' => $state
         ]);
     }),
 Forms\Components\TextInput::make('sellingPoint.name')
     ->reactive()
     ->afterStateUpdated(function (?VendingMachine $record, $state) {
         $record?->sellingPoint?->update([
             'name' => $state
         ]);
     }),


Then the input field never gets it's value. However saving works (due to that after state updated callback).

In the table view it works just fine;

Tables\Columns\TextColumn::make('sellingPoint.name')->label('Name')->searchable(),
Tables\Columns\TextColumn::make('sellingPoint.name')->label('Name')->searchable(),


What am I missing here?
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

Url parameter in form filling
FilamentFFilament / ❓┊help
3y ago
form relation fields in edit form not filling. it's empty
FilamentFFilament / ❓┊help
2y ago
Filling a form temporary
FilamentFFilament / ❓┊help
3y ago
Filling in hasMany relationship from Filament form
FilamentFFilament / ❓┊help
3y ago