Determine if an item exists in the collection.

@param  mixed  $key
@param  mixed  $operator
@param  mixed  $value
@return bool
552257
public function contains($key, $operator = null, $value = null)
    {
        if (func_num_args() == 1) {
            if ($this->useAsCallable($key)) {
                $placeholder = new stdClass;

                return $this->first($key, $placeholder) !== $placeholder;
            }

            return in_array($key, $this->items);
        }

        if (func_num_args() == 2) {
            $value = $operator;

            $operator = '=';
        }

        return $this->contains($this->operatorForWhere($key, $operator, $value));
    }
1205730
public function where($key, $value = true, $operator = '=')
    {
        return $this->addCondition($key, $value, $operator, 'where');
    }
1231334
public function orWhere($key, $value = true, $operator = '=')
    {
        $this->where->setGlue('OR');

        return $this->where($key, $value, $operator);
    }
639953
private function itemSet($value, $key = null)
    {
        if (is_null($key)) {
            $this->items[] = $value;
        } else {
            $this->items[$key] = $value;
        }
    }
997298
public function contains($key, $value = null): bool
    {
        if (func_num_args() == 2) {
            return $this->contains(function ($k, $item) use ($key, $value) {
                return ArrayHelper::getValue($item, $key) == $value;
            });
        }

        if ($this->useAsCallable($key)) {
            return !is_null($this->first($key));
        }

        return in_array($key, $this->items);
    }
1022254
public function pullAll($field, $value, $operator = null)
    {
        return $this->pull($field, $value, $operator, true);
    }
379884
public function orHaving($key, $operator, $value): IQueryBuilderHandler
    {
        return $this->having($key, $operator, $value, 'OR');
    }
105309
public function orHaving(string $key, string $operator, $value): SelectQueryBuilder
    {
        $this->addHaving($key, $operator, $value, 'OR');
        return $this;
    }
1117944
public function containsStrict($key, $value = null)
    {
        if (func_num_args() == 2) {

            return $this->contains(function ($item) use ($key, $value) {

                return ArrayHelper::dataGet($item, $key) === $value;
            });
        }

        if ($this->useAsCallable($key)) {

            return !is_null($this->first($key));
        }

        return in_array($key, $this->items, true);
    }
988251
public function contains($key, $value)
    {
        if (isset($this->values[$key])) {
            return $this->values[$key]->contains($value);
        }

        return false;
    }
854759
public function orWhereIn($key, $value, $operator = 'IN')
    {
        $exp = explode(',', $value);
        $this->where[] = 'OR OR'.$key.' '.$operator.' ('.$this->createPlaceHolder($exp).') ';

        foreach ($exp as $key => $val) {
            $this->bindings[$key] = $val;
        }

        return $this;
    }
322532
public function hasChild($key = null, $value = null, Collect $data = null)
    {
        if (func_num_args() < 3) {
            $data = $this->data;
            $key = $this->parent;
            $value = current(func_get_args());
        }

        $child = false;

        $data->each(function ($item) use (&$child, $key, $value) {

            if (intval($item[$key]) == intval($value) && !$child) {
                $child = true;
            }

        });

        return $child;
    }
1210762
public function findAllBy($key, $value, $operator = '=')
    {
        $query = $this->make();
        return $query->where($key, $operator, $value)->get( $this->getParameters );
    }
438013
public function has(string $key, $value = null): bool
    {
        return is_null($value)
            ? isset($_SESSION[$key])
            : isset($_SESSION[$key]) && $_SESSION[$key] == $value;
    }
930696
public function contains($value)
    {
        $hash = self::hash($value);
        return array_key_exists($hash, $this->objects);
    }
1022602
public function whereJson($key, $operator, $value = null)
    {
        return $this->filter($this->jsonOperator(...func_get_args()));
    }
796803
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;
            }
        };
    }