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');
}


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
         ]);
     }),


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(),


What am I missing here?
Was this page helpful?