Apply WhereIn Condition on json_encode data
Copy Below Code
View As A Text File
Show Text Only
Show API
Edit Code
MySQL expects a JSON string:
$leads->whereRaw('JSON_CONTAINS(user, ?)', [json_encode($users)])
In Laravel 5.6.24 you can use whereJsonContains():
$leads->whereJsonContains('user', $users)
$users==[]