bruli/php-value-objects
A lightweight PHP library for building immutable value objects with typed primitive wrappers and validation. bruli/php-value-objects helps enforce domain invariants, reduce primitive obsession, and keep Laravel or any PHP codebase clearer and safer.
Email, Money, and Uuid wrappers (with divergent validation rules), this package is a candidate shared vocabulary. The decision is "adopt a small MIT library" vs. "standardize an internal package" vs. "leave to each team."Consider it when:
Look elsewhere when:
ramsey/uuid or symfony/uid; for money, moneyphp/money or brick/money; for broader typed collections and primitives, spatie/laravel-data (with Laravel casting support) or Doctrine embeddables.Castable attributes and FormRequest integration out of the box, you will be writing glue code.For executives (one paragraph): We are evaluating a small, MIT-licensed PHP library that packages common "value objects" — validated, immutable building blocks for things like emails, identifiers, and monetary amounts. The business case is defect prevention and delivery speed on domain-heavy features (onboarding, billing, tenancy): validation rules live in one typed place instead of being re-implemented per screen, which reduces data-quality bugs and duplicated logic. Cost is effectively zero in licensing and low in integration, but the library has a small community footprint, so the recommendation is to treat it as a reference implementation we vendor or fork, not a strategic dependency. This is an engineering-led decision with a modest, measurable quality payoff — not a platform bet.
For engineering leads:
ramsey/uuid and moneyphp/money.How can I help you explore Laravel packages today?