Skip to content

Commit

Permalink
'fix_bug'
Browse files Browse the repository at this point in the history
  • Loading branch information
huangbule committed Mar 15, 2024
1 parent 2285e9b commit 02c251d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Traits/FilterTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,8 @@ public function scopeFilter($query, $param = [], $arr_filter = [])
if (!$method_exists)
throw new NotFoundException($filter_name . " not found");

if (!empty($param[$search_key])) {
//laravel middleware will convert empty string to null
if (isset($param[$search_key]) && !is_null($param[$search_key])) {
$callback = $this->createFilterClosure($filter_name, $search_key, $param);
if ($relation) {
$query->whereHas($relation, $callback);
Expand Down

0 comments on commit 02c251d

Please sign in to comment.