Replies: 1 comment 2 replies
-
It already is possible in many, but not all, cases: via
via
But yeah, it would be easier if one didn't have to look up whether a certain rule already has a class or not. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hey,
Laravel and PHP get safer to use with every release. We have Enums and use classes a lot more for configuration then strings nowadays. But we still have this set up strings to define Validation Rules. Extra arguments are chained onto the string which makes it even worse.
I'd love to see rules move to their own classes. This gives us auto-completion, less typos and methods to configure the rules. Using the example from the docs, we could transform this:
to this:
What are your thoughts on this?
Beta Was this translation helpful? Give feedback.
All reactions