Level 15
For someone else who might have the same problem
whereRaw('JSON_CONTAINS(`data`, \'{"value":"'.$value.'"}\')');
1 like
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I have an column like this:
"data": "[{"value":"0"},{"value":"3"}]"
column name data with json data, how can i query json data in orWhere query
I have something like this that doesn't work, i have tried may things no success, what im doing wrong ?
orWhereRaw('JSON_CONTAINS(data->"$.value", \'["0"]\')');
Please or to participate in this conversation.