I have a mysql table with a JSON column with data looking like that :
"[
{\"messageId\":\"0A0000000123ABCD1\",\"status\":\"request\\/0\",\"messagePrice\":\"0.03330000\"},
{\"messageId\":\"0A0000000123ABCD2\",\"status\":\"request\\/0\",\"messagePrice\":\"0.03330000\"}
]"
How can I query the database to get the row containing a specific messageId (messageIds are uniques) ?
I tried :
DB::table('my_table')
->whereJsonContains('my_json_column',[['messageId'=>'0A0000000123ABCD1']]);
But I get no results.
Edit : I can make it work with a simple where like :
DB::table('notification_history')
->where('nexmo_responses','like','%0A0000000123ABCD1%')
->get();
But it's not really a clean way to do it.