diff --git a/src/MicheleAngioni/Support/Repos/AbstractEloquentRepository.php b/src/MicheleAngioni/Support/Repos/AbstractEloquentRepository.php index 11a957a..91d2baa 100644 --- a/src/MicheleAngioni/Support/Repos/AbstractEloquentRepository.php +++ b/src/MicheleAngioni/Support/Repos/AbstractEloquentRepository.php @@ -610,6 +610,7 @@ public function countWhereHas($relation, array $where = [], array $whereHas = [] /** * Apply the where clauses to input query. + * $where can have the format ['key' => 'value'] or ['key' => [, 'value']] * * @param Builder $query * @param array $where @@ -622,7 +623,11 @@ protected function applyWhere(Builder $query, array $where) if (is_null($value)) { $query = $query->whereNull($key); } else { - $query = $query->where($key, '=', $value); + if (is_array($value)) { + $query = $query->where($key, $value[0], $value[1]); + } else { + $query = $query->where($key, '=', $value); + } } }