src/Jedrzej/Searchable/SearchableTrait.php
protected function getConstraints(Builder $builder, array $query)
    {
        $constraints = [];
        foreach ($query as $field => $values) {
            if ($this->isFieldSearchable($builder, $field)) {
                $constraints[$field] = $this->buildConstraints($values);
            }
        }

        return $constraints;
    }
protected function getConstraints(Builder $builder, array $query)
    {
        $constraints = [];
        foreach ($query as $field => $values) {
            if ($this->isFieldSearchable($builder, $field)) {
                $constraints[$field] = $this->buildConstraints($values);
            }
        }

        return $constraints;
    }
protected function getConstraints ( Builder $ builder , array $ query ) { $ constraints = [ ] ; foreach ( $ query as $ field => $ values ) { if ( $ this -> isFieldSearchable ( $ builder , $ field ) ) { $ constraints [ $ field ] = $ this -> buildConstraints ( $ values ) ; } } return $ constraints ; }
Builds search constraints based on model's searchable fields and query parameters.

@param Builder $builder query builder
@param array   $query   query parameters

@return array
Builds search constraints based on model s searchable fields and query parameters .