FilamentF
Filament2y ago
13 replies
nowak

Disabled Select field inside Repeater item not storing data

I have this Select field insider my Repeater item:
Forms\Components\Select::make('attributeValues')
  ->label(false)
  ->disabled()
  ->relationship('attributeValues', 'value')
  ->hidden(fn (Get $get) => ProductType::find($get('../../product_type_id'))?->name == 'Simple')

Which I have disabled because it is purely there to store relationship data in a pivot table.
When I disable the Select field, the relationship data is not stored in the pivot tabel, but if I remove ->disabled() the data is saved as expected.
Is there a way to disable or hide a Select field like this, while still storing the data in the pivot table?
Solution
saveRelationshipsWhenHidden
Was this page helpful?