laravel search inside array column
Solution1: ->whereJsonContains('user_id', 3)
Solution2: ->whereRaw("JSON_CONTAINS(user_id, '[3]' )")
Solution3: ->where('user_id','like',"%{$id}%")
Solution4: Person::hasJob($job->id);
// Inside Model
public function scopeHasJob($query, $jobId)
{
return $query->where('user_id', 'like', "%\"{$userId}\"%");
}