We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent aeedead commit 423c24fCopy full SHA for 423c24f
src/Filters/Scope.php
@@ -16,6 +16,7 @@
16
use LaravelJsonApi\Eloquent\Filters\Concerns\DeserializesValue;
17
use LaravelJsonApi\Eloquent\Filters\Concerns\IsSingular;
18
use LaravelJsonApi\Validation\Filters\ValidatedWithRules;
19
+use LaravelJsonApi\Validation\Rules\JsonBoolean;
20
21
class Scope implements Filter
22
{
@@ -75,6 +76,18 @@ public function apply($query, $value)
75
76
);
77
}
78
79
+ /**
80
+ * @return array
81
+ */
82
+ protected function defaultRules(): array
83
+ {
84
+ if ($this->asBool) {
85
+ return [(new JsonBoolean())->asString()];
86
+ }
87
+
88
+ return [];
89
90
91
/**
92
* @return string
93
*/
0 commit comments