Array of enum validation #564
Unanswered
AmirRezaM75
asked this question in
Q&A
Replies: 2 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.
0 replies
-
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
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