Class Attribute‑based validation package for Laravel users #58422
Unanswered
dconco
asked this question in
Show and tell
Replies: 1 comment 8 replies
-
|
It doesn't work with Laravel models out of the box, because Eloquent as an ORM follows the active record pattern, meaning, database columns are not actual properties on the model. And for DTOs, there's already |
Beta Was this translation helpful? Give feedback.
8 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.
-
Hi Laravel team, I built an attribute‑based request validator package on Composer that works well with Laravel models or DTOs. It uses PHP 8 attributes for rules like #[Email], #[MinLength], #[Enum], and a class marker #[Validatable]. It returns a consistent error payload with message + errors.
I’m sharing it here to get feedback from the community and see if anyone wants to try it. Happy to improve or add Laravel‑specific integration if there’s interest.
Repo/Example usage: https://github.com/dconco/phpspa-validator
Beta Was this translation helpful? Give feedback.
All reactions