nicolopignatelli/valueobjects
Laravel-friendly PHP value objects library that helps you model domain concepts as immutable, self-validating objects (like Email, Money, Url, etc.). Encourages DDD patterns, clearer APIs, and safer data handling with consistent validation and comparison.
Money, Email, Percentage), reducing anemic domain models and improving code clarity.Money, Duration, UUID).Money objects with currency validation.ProductSKU, ShippingAddress, or DiscountCode validation.Timestamp or Metric objects for ETL processes.UserEmail, OrderTotal).For Executives: "This package lets us model core business concepts (like money, emails, or discounts) as self-validating, immutable objects—reducing bugs and speeding up feature delivery. For example, instead of passing raw strings for emails or floats for prices (which can break in production), we’d enforce correctness at code level. This aligns with our DDD goals and cuts tech debt for financial/e-commerce features. Low risk: it’s a lightweight, battle-tested library with minimal overhead."
For Engineers: *"This gives us a type-safe, immutable way to handle domain logic without boilerplate. Key wins:
if (empty($email) || !filter_var($email, FILTER_VALID_EMAIL))—validation happens at instantiation.Money object can enforce currency rules or tax calculations once, reused everywhere.new Money(100, 'USD') instead of ['amount' => 100, 'currency' => 'USD'] with manual checks.How can I help you explore Laravel packages today?