Repository navigation
v1.1.0: Core Schemas Expansion & PHP Enum Support
What's Changed in v1.1.0
This release brings massive feature parity updates with the official Zod JS library, introducing a host of new core schemas, deep PHP native Enum support, and dozens of new validation methods for strings, numbers, and objects.
✨ New Features
- New Core Schemas: Added support for
Z::bigint(),Z::date(),Z::void(),Z::undefined(),Z::nan(),Z::map(),Z::set(),Z::discriminatedUnion(), andZ::pipeline(). - PHP Native Enum Support: Introduced
Z::nativeEnum()and enhancedZ::enum()to natively support PHP 8.1BackedEnumandUnitEnuminstances alongside standard string literals. - ISO Validation Utility: Added a new
Z::iso()utility with built-in validation helpers for.date(),.time(), and.datetime().
🚀 Schema Enhancements
- Base Schema: Added fluent composition methods
.or(),.and(), and.pipe(). - String Validations: Massively expanded string schema capabilities with
.trim(),.toLowerCase()/.lowercase(),.toUpperCase()/.uppercase(),.startsWith(),.endsWith(),.includes(),.url(),.uuid(),.ip()(including IPv4/IPv6 specific options),.cidr(), and.base64(). - Number Validations: Introduced strictly exclusive limiters
.gt()and.lt(), as well as a.safe()integer range checker. - Object Methods: Added standard object manipulation tools:
.merge(),.pick(),.omit(),.partial(),.required(), and.keyof(). - Array Methods: Added the
.element()method to easily retrieve the underlying element schema. - Optional Schema: Improved parsing logic to cleanly and safely handle explicit
nullinputs.
✅ Testing & Internal
- Test Coverage: Added comprehensive test suites for
BigIntSchema,DateSchema,MapSchema,NanSchema,SetSchema,VoidSchema,Iso, and all newly added schema methods. - Feature Tracking: Added a
checklist.mdto map and track ongoing feature parity with the JS Zod library. - Dependencies: Locked project dependencies via
composer.lockand updated.gitignore.
Full Changelog: 1.0.0...1.1.0