src/Jedrzej/Searchable/SearchableTrait.php
protected function applyConstraints(Builder $builder, array $constraints, $mode = Constraint::MODE_AND)
    {
        foreach ($constraints as $field => $constraint) {
            if (is_array($constraint)) {
                foreach ($constraint as $single_constraint) {
                    $this->applyConstraint($builder, $field, $single_constraint, $mode);
                }
            } else {
                $this->applyConstraint($builder, $field, $constraint, $mode);
            }
        }
    }
protected function applyConstraints(Builder $builder, array $constraints, $mode = Constraint::MODE_AND)
    {
        foreach ($constraints as $field => $constraint) {
            if (is_array($constraint)) {
                foreach ($constraint as $single_constraint) {
                    $this->applyConstraint($builder, $field, $single_constraint, $mode);
                }
            } else {
                $this->applyConstraint($builder, $field, $constraint, $mode);
            }
        }
    }
protected function applyConstraints ( Builder $ builder , array $ constraints , $ mode = Constraint :: MODE_AND ) { foreach ( $ constraints as $ field => $ constraint ) { if ( is_array ( $ constraint ) ) { foreach ( $ constraint as $ single_constraint ) { $ this -> applyConstraint ( $ builder , $ field , $ single_constraint , $ mode ) ; } } else { $ this -> applyConstraint ( $ builder , $ field , $ constraint , $ mode ) ; } } }
Applies constraints to query, allowing model to overwrite any of them.

@param Builder      $builder     query builder
@param Constraint[] $constraints constraints
@param string       $mode        determines how constraints are applied ("or" or "and")
Applies constraints to query allowing model to overwrite any of them .