protected function compileConstraint($constraint)
    {
        return function ($value) use ($constraint) {

            if (!$value instanceof MatchesCollection) {
                return $this->checker->check($value, $constraint);
            }

            // Matching values against sequential arrays will result in
            // checking if ANY of the values matches the criteria.
            // This will allow normal sql like "WHERE categories.id = 13" queries
            foreach ($value as $item) {
                if ($this->checker->check($item, $constraint)) {
                    return true;
                }
            }

            return false;

        };
    }
protected function compileConstraint($constraint)
    {
        return function ($value) use ($constraint) {

            if (!$value instanceof MatchesCollection) {
                return $this->checker->check($value, $constraint);
            }

            // Matching values against sequential arrays will result in
            // checking if ANY of the values matches the criteria.
            // This will allow normal sql like "WHERE categories.id = 13" queries
            foreach ($value as $item) {
                if ($this->checker->check($item, $constraint)) {
                    return true;
                }
            }

            return false;

        };
    }
protected function compileConstraint ( $ constraint ) { return function ( $ value ) use ( $ constraint ) { if ( ! $ value instanceof MatchesCollection ) { return $ this -> checker -> check ( $ value , $ constraint ) ; } // Matching values against sequential arrays will result in // checking if ANY of the values matches the criteria. // This will allow normal sql like "WHERE categories.id = 13" queries foreach ( $ value as $ item ) { if ( $ this -> checker -> check ( $ item , $ constraint ) ) { return true ; } } return false ; } ; }
Compile a constraint or group.

@param ConstraintContract|ConstraintGroupContract $constraint

@return \Closure
Compile a constraint or group .