Custom Field does not submit data
Created a custom field as in the docs, using
And I use it in my form as:
The view of my custom component is:
And an input field is indeed generated for every currency:
In
Other values of 'default' Filament form fields are there but I cannot figure out why my custom field
artisan make:form-field ProductPrices. The component looks like this and receives an array of Currency models:And I use it in my form as:
The view of my custom component is:
And an input field is indeed generated for every currency:
<div><input wire:model="data.pricesTest.1"></div>In
EditProduct extends EditRecord, where I use the ProductResource with said form I do a dd():Other values of 'default' Filament form fields are there but I cannot figure out why my custom field
PricesTest isn't submitted into the form data. Can someone please point me where I'm going wrong?Solution
Thanks again for your help @Lara Zeus . It seems that the
setup() function in the ProductPrices does the trick. I think it needs to be setup as an array. And it works when setting it up in the same way that CheckboxList() does. Final working code of the custom field: