I have a column name test in which I am storing a JSON data and the data is like this
{
"id": 4030662213806,
"buyer_accepts_marketing": true,
"cancel_reason": null,
"cancelled_at": null,
"line_items": [
{
"id": 10357822685358,
"vendor": "Samsung-1",
},
{
"id": 10357822685358,
"vendor": "Samsung-2",
},
{
"id": 10357822685358,
"vendor": "Samsung-3",
}
],
}
I am trying to get data where vendor value is Samsung-1
and my query is like this
$query = Test::where('id','4030662213806')
$query->orWhereJsonContains('test->line_items->vendor',$val);
also tried
$query->orWhereJsonContains('test->line_items->vendor',$val);
But didn't work
Any help please
teston there.line_items->vendortestis your table name but you say you have also a column namedtestI think you have a mistake here.