wendelladriel/laravel-validated-dto
Build typed Data Transfer Objects for Laravel that validate incoming data using familiar validation rules, defaults, and casting. Create DTOs by extending ValidatedDTO, define rules(), and get safe, validated, ready-to-use properties for your app.
CreateOrderDTO, UpdateUserProfileDTO).UserDTO::fromArray([...])).$casts with validated DTOs for nested attributes (e.g., metadata as AttributesDTO).Adopt if:
FormRequest classes).Look elsewhere if:
required|string|email rules) and Laravel’s native validation suffices."This package lets us standardize and automate data validation across our Laravel applications, reducing bugs and developer time. By replacing manual validation logic with reusable, type-safe DTOs, we’ll cut maintenance costs and improve API reliability. For example, instead of writing 10 similar FormRequest classes, we’ll define one UserDTO with validation rules, reducing technical debt. It’s a low-risk, high-reward investment in code quality."
*"This solves our validation spaghetti problem. With laravel-validated-dto, we can:
UserDTO::fromRequest()).DTOCast, ModelCast).UserDTO::fromArray([...])).How can I help you explore Laravel packages today?