The bottom doesn't show how many. But the bottom is valid json. I'd suggest experiment with storing and outputs to determine what is needed.
Edit:
See here for an online json validator: https://jsonlint.com/
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
hello , I saw many examples of working with json field in Laravel + mysql . most of examples stores data in mysql like that -
features that has in house property ( example ) -
{ "swimming_poll": 1, "garage": 1, "soccer field": 1 }
could I store the data like this as an Array in json my_sql field ?
["swimming_poll", "garage", "soccer field"]
wold be a good approach ?
@ctyler I would still not use json for it, the main reason for that is that you have a set number of fields in your position. If it would have been a variable amount of fields then maybe I would have considered using a json column, or maybe a "key value" table. What I mean by that is that I would store each property and it's value in it's own record rather than in columns or json.
Please or to participate in this conversation.