Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Doctrine Orm Value Object Laravel Package

matthiasnoback/doctrine-orm-value-object

A Doctrine ORM integration for mapping PHP value objects as embeddables, with support for custom types and conversion between value objects and database columns. It helps keep domain models free of ORM concerns while persisting rich value objects transparently.

Deep Wiki
Context7

Product Decisions This Supports

  • Persistence architecture choice: Informs whether a Laravel codebase should lean on Eloquent (with custom casts) or bring Doctrine ORM in for richer domain modeling. This package only matters in the second scenario, so it forces the team to make that strategic call explicitly.
  • Domain modeling quality / refactoring roadmap: Supports initiatives to remove primitive obsession (money, email, address, date ranges as first-class types) inside the entity layer rather than strings and floats everywhere.
  • Build vs buy for persistence plumbing: A candidate replacement for hand-written DBAL types and custom Eloquent casts per value object — useful when the team is writing the same type-mapping boilerplate across multiple bounded contexts.
  • Feature scoping for rich domains: Relevant to features with strong invariants (payments, pricing, identity), where encapsulating validation in value objects reduces defect surface in entities.
  • Modernization / migration planning: Relevant if the roadmap includes bringing Symfony/Doctrine-style domain code into a Laravel application, or maintaining a mixed ORM estate.

When to Consider This Package

  • Consider it when: the team has committed to Doctrine ORM inside Laravel (e.g., via laravel-doctrine/orm), wants value objects persisted without per-type custom code, and is willing to pin Doctrine versions deliberately.
  • Strong fit if: you already practice DDD, have a library of value objects, and are hitting friction writing and maintaining DBAL custom types repeatedly.
  • Look elsewhere when: the application is Eloquent-first — use CastsAttributes / custom casts or AsArrayObject/AsEnumCollection instead; this package solves a problem you don't have.
  • Caution flags: 19 stars and a low composite score suggest a niche, low-activity dependency. Verify Doctrine ORM 2.x/3.x and PHP version compatibility, release cadence, and issue responsiveness before adopting. Matthias Noback's authorship is a quality signal, but it is not a maintenance guarantee.
  • Alternatives: Doctrine's native embeddables, PHP 8.1+ readonly classes with custom casts, or a small in-house DBAL type if you only have one or two value objects.

How to Pitch It (Stakeholders)

  • To executives: This is a small, low-risk utility, not a strategic bet. It only becomes relevant if we decide to run Doctrine ORM alongside Eloquent to support richer domain models. Cost of evaluation is low; cost of adoption in an Eloquent-only app is effectively zero because it doesn't apply.
  • To engineering: If we go Doctrine, this saves us from writing and maintaining one custom DBAL type per value object, and keeps mapping logic out of entities. The trade-off is an extra, lightly-maintained dependency — so we should budget a short spike to confirm version compatibility and decide between this, embeddables, or a thin in-house type layer.
  • Recommended next step: A 1–2 day spike validating Doctrine + this package against our PHP/Doctrine versions in a throwaway branch, with a clear fallback to Eloquent custom casts if the dependency proves stale.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
jinas/dhivatar
store-doc/laravel-storage-driver
plus-it/laravel-translation-manager
diephp/perhaps
diephp/telegraph
osmaviation/spreadsheet
microsoft/fluentui-system-icons
mmccook/php-json-canonicalization-scheme
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console
pnscripts/filament-broadquill-lite
pnscripts/laravel-sentfold-lite
vleap/mx-sdk-laravel-internal
twidpay/utils
htetmyathlaing/scout-elasticsearch-driver
artisan-toolbox/front-awesome
ls/client-assistant
users-au/laravel-client
cgv/localized-resource