FilamentF
Filament3y ago
*

Inserting pivot data without RelationManager

I have a multiple select on an edit page, has a belongsToMany() relationship.

I want to inject something to be saved in a column in the pivot table.

I found out that the relationship is saved in HasState::getState(), but could not find a way to inject additional data to it.

Tried mutateFormDataBeforeSave() in the EditThing component, but that gets called after getState(), so no effect.

Any help would be appreciated.
Was this page helpful?