Saving hidden fields in a wizard component

Hello All, Any workaround on how to save hidden form field upon form submit. The field is "unit_cost_price" as shown in the attach image. note: without the hidden attribute, it works fine as expected, the issue arises when I chained the hidden method
4 Replies
awcodes
awcodes12mo ago
->hidden() removes the field completely from the form. Whereas a Hidden::make() will create a hidden input. But seeing as this has to do with cost it is best to handle this as Leandro suggested on the backend. Hidden inputs can be manipulated on the front end.
The_Gooner
The_GoonerOP12mo ago
Hey, Leandro's recommendation was initially considered, however, the "unit_cost_price" field is part of a relationship called on a Repeater component and can't access the relationship data on the backend. Basically the relationship is not part of the submitted form data.
LeandroFerreira
LeandroFerreira12mo ago
I think if you want to save it manually, you could do ->dehydrated(true) in the repeater and get the data using hooks
Want results from more Discord servers?
Add your server