I have a database column field that contains an array of objects like this:
[
{
"label": "0-1",
"key": 1
},
{
"label": "1-3",
"key": 2
},
{
"label": "3-7",
"key": 3
}
]
How can I query by the label? To return if the matching label exists?
Update: this worked for me:
Model::whereJsonContains('column', ['label' => '0-1']);