Skip to content

Commit 5fd264c

Browse files
committed
wip
1 parent f38db85 commit 5fd264c

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

validation.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1245,6 +1245,14 @@ The `Enum` rule is a class based rule that validates whether the field under val
12451245
'status' => [Rule::enum(ServerStatus::class)],
12461246
]);
12471247

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+
Rule::enum(ServerStatus::class)
1254+
->except([ServerStatus::Pending, ServerStatus::Active]);
1255+
12481256
<a name="rule-exclude"></a>
12491257
#### exclude
12501258

0 commit comments

Comments
 (0)