Declare your constructor properties — hydration, serialization, and validation happen automatically via PHP attributes.
🔒
Fully typed
Readonly properties, nested DTOs, enums, typed collections, and IDE-aware generics out of the box.
🎯
Attribute-driven
#[Cast], #[Rules], #[Flatten], #[Hidden], #[IgnoreIfNull] — all behaviour defined where the property is declared.
🚀
Production-ready performance
Hydration and serialization compile to per-class closures. The file cache plus the sdo-warm CLI give production zero reflection and zero runtime compilation.
🛡️
Secure by default
EncryptedCast uses XSalsa20-Poly1305 authenticated encryption. Validation throws before any hydration occurs.
🔗
Laravel integration
Optional trait adds fromRequest(), fromModel(), and toResponse(). Validation rules run automatically on fromRequest().