Array of enum validation #564
Replies: 3 comments
-
At the moment such a thing does not exist, you could always add such an attribute in your own project. Not sure if we want this in the package but it could be useful. My first idea would be an #[ArrayOf(new Enum(ShipmentMethod::class))] // ['methods.*' => 'enum: ShipmentMethod']
Not sure about the name and how to implement it but looks like an interesting experiment. |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
Hello there, Is there an update on this subject? Thank you! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Is there any predefined attribute that checks if the given input is an array of specific enum?
If NO. Do you have any plan for that? Is this feature valid for a pull request or do you prefer to not include it in package's source code and handle it with custom casts?
Expectation:
$request->methods
returns array of ShipmentMethod enumsBeta Was this translation helpful? Give feedback.
All reactions