Skip to content

Commit 50635f4

Browse files
committed
fix when callback
1 parent 0f082f5 commit 50635f4

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/EloquentFilters.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,9 @@ public function apply($builder)
5555
if (method_exists($this, $filter) && count($params) > 1) {
5656
call_user_func_array([$this, $filter], $params);
5757
} else {
58-
$this->builder->when($value ?? null, $this->$filter($value));
58+
$this->builder->when($value ?? null, function () use ($filter, $value) {
59+
return $this->$filter($value);
60+
});
5961
}
6062
}
6163

0 commit comments

Comments
 (0)