'repeatable' & 'subfields' & 'store_in' issue #957
-
I'm using this way https://backpackforlaravel.com/docs/6.x/crud-fields#optional-fake-field-attributes-stores-fake-attributes-as-json-in to store json data to a repeatable field. This my CRUD field:
Store method works fine and i see data on db fields Putting a dd(get_defined_vars()); on top of my custom_superenalotto_numbers.blade.php i see this: I don't understand why the custom field blade works fine creating and not updating :( Some help ? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 7 replies
-
Hello @blondie63 can you share the content of custom_superenalotto_numbers field. Thanks. |
Beta Was this translation helpful? Give feedback.
-
Hi @blondie63 as i named before you need to take as an example "date_range" there is saving multiple values for a field and is you check in detail, declaration is an array, so check thats field in detail and you will be able to save and then recovery many values in a field, is needed to handle manually many things in this case. Cheers. |
Beta Was this translation helpful? Give feedback.
-
I tried in every way to manage an array inside the "game" field but I couldn't! |
Beta Was this translation helpful? Give feedback.
your custom field is not correctly handle the saving, the name of subfield need to be consistent with the name of saving values, so per example, the name of your field is "giocata", tha save json is "[{"n1":"1","n2":"2","n3":"3","n4":"4","n5":"5","n6":"6","superstar":"7"}]", there is no way Backpack will know nX is the same as giocata, if you check date_range, the name of field is 'start_date,end_date', the save json is "[{"start_date":"2024-04-16 00:00:00","end_date":"2024-05-17 23:59:59"}]", you see the point?
Cheers.