We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f38db85 commit 5fd264cCopy full SHA for 5fd264c
validation.md
@@ -1245,6 +1245,14 @@ The `Enum` rule is a class based rule that validates whether the field under val
1245
'status' => [Rule::enum(ServerStatus::class)],
1246
]);
1247
1248
+The `Enum` rule's `only` and `except` methods may be used to limit which enum cases should be considered valid:
1249
+
1250
+ Rule::enum(ServerStatus::class)
1251
+ ->only([ServerStatus::Pending, ServerStatus::Active]);
1252
1253
1254
+ ->except([ServerStatus::Pending, ServerStatus::Active]);
1255
1256
<a name="rule-exclude"></a>
1257
#### exclude
1258
0 commit comments