@brunokaue Does it work for you?
$query->where('info', '!=', null)
->whereJsonContains('info->users[*]->name', 'LIKE', '%'.$name.'%');
Hello, today i have a model with a column info the default value is null...
I need search inside this column where has users, but inside the users i have array with name and email.
The question is, how can i search inside users looking for name using like operator?
I've tried:
$query->whereJson('info->users->name', 'like', '%'.$name.'%') without success!
$query->whereJson('info->users[*]->name', 'like', '%'.$name.'%') without success!
Please or to participate in this conversation.