From be4961606512955dbda4cfd7007061864cfd5206 Mon Sep 17 00:00:00 2001 From: kriss <462679766@qq.com> Date: Sat, 29 Mar 2025 14:34:38 +0800 Subject: [PATCH] feature: support amis empty string search --- src/Repository/EloquentRepository.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Repository/EloquentRepository.php b/src/Repository/EloquentRepository.php index e036f66..045d55d 100644 --- a/src/Repository/EloquentRepository.php +++ b/src/Repository/EloquentRepository.php @@ -107,7 +107,7 @@ protected function buildSearch(EloquentBuilder $query, array $search): EloquentB { $searchableAttributes = $this->searchableAttributes(); foreach ($search as $attribute => $value) { - if (array_key_exists($attribute, $searchableAttributes)) { + if (array_key_exists($attribute, $searchableAttributes) && $value !== '' && $value !== null) { $query = call_user_func($searchableAttributes[$attribute], $query, $value, $attribute); } }