funeralzone/valueobjects
PHP 7.1+ value object toolkit for fundamental scalar-based VOs. Provides traits for strings/ints/etc, enums via constants, easy native serialization (fromNative/toNative), and encourages domain validation logic. Includes extension library for complex objects.
Money, Email, Percentage), aligning with DDD principles for cleaner architecture.Address, DateRange).Money, ProductSKU, ShippingAddress.UserEmail, SubscriptionPlan, APIRateLimit.InvoiceNumber, TaxRate, AuditLogEntry.Adopt if:
Look elsewhere if:
spatie/value-object).symfony/ux or custom solutions).For Executives:
"This package lets us model business data as self-contained, validated objects (e.g., Money, Email), reducing bugs and improving code clarity. For example, instead of storing a raw price as a float in the database, we’d use a Money object that enforces currency rules and validation—cutting support costs and enabling safer refactoring. Low risk (MIT license), high reward for complex domains like payments or inventory. Comparable to tools like Ruby’s Money gem but for PHP."
For Engineers:
*"The funeralzone/valueobjects package gives us a lightweight, immutable value object framework for PHP/Laravel. Key benefits:
Email::validate()) and reuse across the app.string|int with Email, Money, or Percentage for clearer intent.$price = new Money(100, 'USD'); // Validates currency, rejects negative values.
Tradeoff: Last updated in 2020, but the pattern is stable. If we need active updates, we could fork or pair with spatie/value-object."*
How can I help you explore Laravel packages today?