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 bdf7c66 commit 0537422Copy full SHA for 0537422
README.md
@@ -318,6 +318,21 @@ VolumeUnitEnum::MILLIGRAMS->isNotAny(['GRAMS', VolumeUnitEnum::TONNE]);
318
VolumeUnitEnum::MILLIGRAMS->isNotAny([VolumeUnitEnum::GRAMS, VolumeUnitEnum::MILLIGRAMS]); // false
319
```
320
321
+### rule
322
+
323
+The backed enums may be validated using Laravel's standard Enum validation rule - `new Illuminate\Validation\Rules\Enum(VolumeUnitEnum::class)`.
324
+This method a shortcut for the validation rule.
325
326
+#### Usage
327
+```
328
+public function rules(): array
329
+{
330
+ return [
331
+ 'volume_unit' => [VolumeUnitEnum::rule()],
332
+ ];
333
+}
334
335
336
## Changelog
337
338
Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.
0 commit comments