Красноречивая поиска Laravel
// Data
/*[
{
"emailAddress": {
"name": "Test",
"address": "test@example.com"
}
},
{
"emailAddress": {
"name": "Test 2",
"address": "test2@example.com"
}
}
]*/
DB::table('emails')
->whereJsonContains('to', [['emailAddress' => ['address' => 'test@example.com']]])
->get()
// Example 2
DB::table('emails')
->whereJsonContains('to', 'like', ['emailAddress' => "%$query%"])->get();
Hiren Reshamwala