P粉2564870772023-08-27 09:02:59
You must try this
$records = DB::table('atble')->select('res_id', 'msg_string')->where('res_id', $param)->whereJsonContains('ret_string->msg', ['object_key' => 'object_value'])->latest()->first();
Also follow the correct guidelines for WhereJsonContains
You can also refer to this linkfor more help
Here is an example, it will help you.
$array = [0 => 1, 1 => 2, 2 => 3]; // Eloquent PaymentTransaction::whereJsonContains('payload->ProductCode- >id',$array)->get();