Skip to content

Commit

Permalink
#4 - Repository / Utils / RepositoryFilter
Browse files Browse the repository at this point in the history
  • Loading branch information
Nandovga committed Jul 24, 2024
1 parent 0cd35bc commit 4dc1596
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Repository/Utils/RepositoryFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ public function getQueryFilter(Builder|EloquentBuilder &$query, array $filter, s
}
}

if (is_int($value) && $field != 'id') {
$query->where($field, '=', $value);
}

if (is_array($value) && $field != 'query' && $field !== 'order') {
$query->whereIn($field, $value);
}
Expand Down

0 comments on commit 4dc1596

Please sign in to comment.