public function search($value, bool $strict = false)
    {
        if (!$strict) {
            /** @var Collection $values */
            $values = $this->copy();
            $values->apply(function ($value) {
                if (is_string($value)) {
                    return strtolower($value);
                }

                return $value;
            });

            $value = strtolower($value);
        } else {
            $values = $this;
        }

        return array_search($value, $values->toArray(), $strict);
    }
public function search($value, bool $strict = false)
    {
        if (!$strict) {
            /** @var Collection $values */
            $values = $this->copy();
            $values->apply(function ($value) {
                if (is_string($value)) {
                    return strtolower($value);
                }

                return $value;
            });

            $value = strtolower($value);
        } else {
            $values = $this;
        }

        return array_search($value, $values->toArray(), $strict);
    }
public function search ( $ value , bool $ strict = false ) { if ( ! $ strict ) { /** @var Collection $values */ $ values = $ this -> copy ( ) ; $ values -> apply ( function ( $ value ) { if ( is_string ( $ value ) ) { return strtolower ( $ value ) ; } return $ value ; } ) ; $ value = strtolower ( $ value ) ; } else { $ values = $ this ; } return array_search ( $ value , $ values -> toArray ( ) , $ strict ) ; }
Search a value in the Collection and return the associated key

If search is not strict, strings will be compared ignoring case

@param mixed $value
@param bool  $strict

@return mixed
Search a value in the Collection and return the associated key