Skip to content

Commit

Permalink
Fixes `Orchestra\Support\Concerns\QueryFilter::buildWildcardForField(…
Browse files Browse the repository at this point in the history
…)` to accept `Illuminate\Database\Query\Expression` as `$field` variable instead of casting it to `string`.

Signed-off-by: Mior Muhammad Zaki <[email protected]>
  • Loading branch information
crynobone committed Jul 10, 2018
1 parent 1fbb719 commit f2f9447
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

This changelog references the relevant changes (bug and security fixes) done to `orchestra/support`.

## 3.6.2

Released: 2018-07-10

### Fixes

* Fixes `Orchestra\Support\Concerns\QueryFilter::buildWildcardForField()` to accept `Illuminate\Database\Query\Expression` as `$field` variable instead of casting it to `string`.

## 3.6.1

Released: 2018-07-07
Expand Down
4 changes: 2 additions & 2 deletions src/Support/Concerns/QueryFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -129,12 +129,12 @@ protected function buildWildcardQueryFilters($query, array $fields, array $keywo
* Build wildcard query filter for field using where or orWhere.
*
* @param \Illuminate\Database\Eloquent\Builder|\Illuminate\Database\Query\Builder $query
* @param string $field
* @param \Illuminate\Database\Query\Expression|string $field
* @param array $keyword
*
* @return \Illuminate\Database\Eloquent\Builder|\Illuminate\Database\Query\Builder
*/
protected function buildWildcardForField($query, string $field, array $keyword)
protected function buildWildcardForField($query, $field, array $keyword)
{
if ($field instanceof Expression) {
return $this->buildWildcardForFieldUsing($query, $field->getValue(), $keyword, 'orWhere');
Expand Down

0 comments on commit f2f9447

Please sign in to comment.