outl1ne / nova-simple-repeatable

A Laravel Nova simple repeatable rows field.
MIT License
72 stars 44 forks source link

Save data as simple JSON array? #36

Closed gazchap closed 1 year ago

gazchap commented 2 years ago

Is it possible with this field to save the field data as an array, in circumstances where there is just one field in the repeatable?

I have a SimpleRepeatable that contains just one Text field (in this case, named pattern) and when saved to my model, the JSON in the database is: [{"pattern": "12345"},{"pattern": "67890"}]

Is it possible to have it save it as just an array, i.e.: ["12345","67890"] ?

KasparRosin commented 2 years ago

Currently we only have the array of json objects solution.

marttinnotta commented 1 year ago

Hi!

If you need to add another field at one point in time then you will lose previous data because of structural change, this is valid reason not to do that. There are other means to transform your data I suggest you use those.

Thank you and good luck!