Don't dehydrate hidden field in Repeater
I have a Repeater field that has a selection for languages. When the selected language is English, I'd like to show some fields, hiding those fields for any other language selection. Issue is that when my form is saved, the hidden fields are populated with null values. How do I avoid this? I don't need them saved.
4 Replies
use
->dehydrated(false)
for any field you want to be ignored by the save process
it accepts also a closureI tried this but it didn't work. I still get null values committed to the DB. PS: The Repeater saves in a JSON field. @Mohamed Ayaou
I think the values will be svaed as null if the key is presented, I think you have to unset the keys as well