public function jsonOperator($key, $operator, $value = null)
    {
        if (func_num_args() === 2) {
            $value = $operator;
            $operator = '=';
        }

        return function ($item) use ($key, $operator, $value) {
            $column = $key;
            if(Str::contains($key, '->')) {
                $explodeKey = explode('->', $key);
                $column = $explodeKey[0];
                $key = $explodeKey[1];
            }

            $retrieved = data_get($item, $column.'.'.$key, null, true);

            $strings = array_filter(
                [$retrieved, $value], function ($value) {
                    return is_string($value) || (is_object($value) && method_exists($value, '__toString'));
                }
            );

            if (count($strings) < 2 && count(array_filter([$retrieved, $value], 'is_object')) == 1) {
                return in_array($operator, ['!=', '<>', '!==']);
            }

            switch ($operator) {
            default:
            case '=':
            case '==':  
                return $retrieved == $value;
            case '!=':
            case '<>':  
                return $retrieved != $value;
            case '<':   
                return $retrieved < $value;
            case '>':   
                return $retrieved > $value;
            case '<=':  
                return $retrieved <= $value;
            case '>=':  
                return $retrieved >= $value;
            case '===': 
                return $retrieved === $value;
            case '!==': 
                return $retrieved !== $value;
            }
        };
    }