Skip to content
This repository was archived by the owner on Sep 27, 2022. It is now read-only.

Commit 3a76b52

Browse files
author
Sandeesh
committed
Allow default values for filter methods.
1 parent 3f7ef19 commit 3a76b52

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

app/RealWorld/Filters/Filter.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,11 @@ public function apply(Builder $builder)
6969

7070
foreach ($this->getFilters() as $name => $value) {
7171
if (method_exists($this, $name)) {
72-
$this->$name($value);
72+
if ($value) {
73+
$this->$name($value);
74+
} else {
75+
$this->$name();
76+
}
7377
}
7478
}
7579

0 commit comments

Comments
 (0)