Skip to content

Commit 9ce694e

Browse files
authored
Revert "skip filter class checker (#207)"
This reverts commit 5528605.
1 parent 5528605 commit 9ce694e

File tree

1 file changed

+8
-12
lines changed

1 file changed

+8
-12
lines changed

src/Filterable.php

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,23 +21,19 @@ trait Filterable
2121
*/
2222
public function scopeFilter($query, array $input = [], $filter = null)
2323
{
24+
// Resolve the current Model's filter
2425
if ($filter === null) {
25-
if (class_exists($this->getModelFilterClass())) {
26-
$filter = $this->getModelFilterClass();
27-
28-
$modelFilter = new $filter($query, $input);
29-
30-
// Set the input that was used in the filter (this will exclude empty strings)
31-
$this->filtered = $modelFilter->input();
32-
33-
// Return the filter query
34-
return $modelFilter->handle();
35-
}
26+
$filter = $this->getModelFilterClass();
3627
}
3728

3829
// Create the model filter instance
30+
$modelFilter = new $filter($query, $input);
31+
32+
// Set the input that was used in the filter (this will exclude empty strings)
33+
$this->filtered = $modelFilter->input();
3934

40-
return $query;
35+
// Return the filter query
36+
return $modelFilter->handle();
4137
}
4238

4339
/**

0 commit comments

Comments
 (0)