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 Laminas Hydrator Laravel Package

doctrine/doctrine-laminas-hydrator

Laminas hydrator integration for Doctrine: extract and hydrate entity data using Doctrine's metadata and object manager, letting you convert between entities and arrays in Laminas applications with strategies for associations, collections, and embedded objects.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture fit. doctrine/doctrine-laminas-hydrator is a bridge library, not a general-purpose PHP utility. It wires laminas/laminas-hydrator strategies into Doctrine's hydration pipeline and registers them through a Laminas PSR-11 service manager. The dependency direction is Laminas → Doctrine, not the reverse. In a Laravel codebase this is a structural mismatch on three axes: (1) Laravel's container is Illuminate's, not laminas-servicemanager; (2) Laravel's default persistence layer is Eloquent, not Doctrine ORM; (3) Laravel's request-to-model path uses form requests, casts, and API resources rather than hydrator strategies. Adopting this package implies adopting two adjacent abstraction layers (Laminas Hydrator plus Doctrine hydration) to solve a problem most Laravel teams solve with Eloquent casts, DTOs, or spatie/laravel-data.

Integration feasibility. Technically possible. The package is MIT-licensed, Composer-installable, and has no exotic native extensions. The realistic path is: add doctrine/orm and a Laravel-Doctrine bridge (laravel-doctrine/orm), then hand-write a service provider that binds Laminas' HydratorManager and the package's hydrator factory into the Illuminate container. That is roughly 100–200 lines of glue plus tests. Feasibility is therefore high in principle, low in marginal value — we would be building the adapter that the package does not ship, to use hydrators in a framework that already has them.

Technical risk. The quantitative signals are weak: 37 stars, zero dependents, and a composite score of 20.755. Zero dependents on a package that has existed for years is the single most important data point — it means no public evidence of production use, no downstream bug reports, and no community-vetted edge cases. Additional risks:

Risk Severity Notes
Ecosystem mismatch High Laminas-first design; Laravel support is not a stated goal
Bus factor / stewardship High Maintained under the Doctrine/Laminas umbrella with low visible activity
Release metadata anomaly Medium Last release dated 2026-10-30 is future-stamped; verify tag provenance before pinning
Abstraction layering Medium Two hydration systems to debug when a mapping breaks
API churn Medium Laminas Hydrator v4 and Doctrine ORM v3 both had breaking changes
Conflict surface Low–Med Overlapping version constraints with Laravel Doctrine bridges

Key questions for the maintainer and for us.

  • Does the project intend to support non-Laminas PSR-11 containers, or is the service-manager coupling permanent?
  • What is the tested matrix (PHP version × laminas-hydrator × doctrine/orm × laminas-servicemanager)? Is there CI on the current LTS lines?
  • Who is the accountable maintainer, and what is the stated deprecation policy?
  • Internally: what concrete pain are we solving — DTO mapping from JSON payloads, legacy entity hydration, or a Laminas-to-Laravel migration? If it is DTO mapping, this package is the wrong tool and we should stop here.
  • Do we already have a Laminas application in the estate that this would need to interoperate with? That is the only strong justification for the dependency.

Integration Approach

Stack fit. Poor as a standalone choice, moderate only in one scenario: an organisation running both a Laminas service and a Laravel service against a shared Doctrine entity model, where consistent hydration semantics across both would reduce translation bugs. Absent that, the fit is negative — we would add a dependency, an adapter, and a second mental model to solve a problem Laravel already solves.

Migration path. There is no meaningful "migrate to this package" story for a Laravel app. The defensible paths are:

  • Greenfield Doctrine entities in Laravel — use laravel-doctrine/orm and Doctrine's native hydrators; skip this package entirely.
  • Legacy Laminas extraction — if a Laminas monolith is being strangled into Laravel services, keep the package on the Laminas side and expose a clean HTTP or message contract to Laravel. Do not import it across the boundary.
  • Shared hydration contract — only if we can prove hydration divergence is causing production defects, and only behind an internal interface we own.

Compatibility. Verify before any commitment: PHP 8.1+ support, laminas/laminas-hydrator v4, doctrine/orm v2 vs v3 (this is the highest-probability breakage point), and laminas/laminas-servicemanager v3. If the Laravel side uses laravel-doctrine/orm, check whether both packages transitively require conflicting doctrine/orm or doctrine/collections ranges. Pin exact versions; do not allow floating constraints on a package with no downstream consumers.

Sequencing. (1) One-week spike: install in a throwaway Laravel app, write the service-provider adapter, hydrate and persist one entity with a nested collection. (2) Decision gate — if the spike requires more than two days of adapter work or surfaces an ORM-version conflict, stop. (3) If proceeding, isolate behind an internal HydratorContract so the package is swappable. (4) Pilot on one bounded context, non-critical, with a rollback path. (5) Only then expand. Total elapsed time to a go/no-go decision: two weeks. Do not allocate more than that up front.

Operational Impact

Maintenance. The package becomes a permanent line item. Laminas Hydrator and Doctrine ORM both ship breaking majors on multi-year cycles; each bump requires validating the adapter. Expect one to two upgrade events per year, each a half-day to two days including regression tests. The absence of dependents means we will be among the first to hit new edge cases — we effectively become a downstream QA resource for free.

Support. Community-only, no SLA, no vendor. Internal ownership is mandatory: a named engineer accountable for the adapter and its upgrade path, documented in the service catalogue. If we cannot staff that, we cannot adopt this. Support burden is low in steady state and spiky at major-version boundaries.

Scaling. Hydration is CPU-bound and stateless; the package itself will not be a bottleneck. Laminas Hydrator's strategy lookup and reflection-based property access carry modest per-object overhead — order of microseconds per entity. For bulk ingestion (thousands of entities per request) reflection costs compound; benchmark against a hand-written mapper before using it in a high-volume import path. Container wiring is boot-time only; cache the resolved hydrator instances rather than resolving per call.

Failure modes to instrument.

  • Silent partial hydration — typed properties left uninitialized or left at defaults when a strategy does not match; produces null-valued entities that fail late at persist time. Mitigate with declare(strict_types=1), non-nullable constructors, and schema assertions in tests.
  • Nested collection mismatch — child hydrators not registered for a collection element type; fails at flush, not at hydrate. Add integration tests covering two-level nesting.
  • Container boot failure — Laminas service-manager bindings resolved lazily inside Illuminate; misconfiguration surfaces at first request, not at deploy. Fail fast with a boot-time smoke test.
  • Version drift — a transitive doctrine/orm bump silently changes hydration strategy resolution. Lock files and CI matrix are the control.
  • Proxy/uninitialized entity interaction — hydrating into Doctrine-managed proxies can behave unexpectedly; keep hydration on the DTO side of the boundary.

Ramp-up. A mid-level PHP engineer needs roughly two to four weeks to become productive with Laminas Hydrator semantics and Doctrine's hydration pipeline — the combination is the cost, not either alone. Add one sprint for the adapter, tests, and documentation. Team-wide, budget one engineer at 20% for the first quarter, dropping to a few days per year thereafter.

Bottom line. Score 20.755 and zero dependents are consistent with what this package is: a competent, narrow bridge for Laminas applications. The 58.93 opportunity score reflects niche completeness, not transferability. For a Laravel-centric estate the recommendation is do not adopt unless a Laminas application is already in scope and shared hydration semantics are demonstrably reducing defects. Run the two-week spike only to falsify that hypothesis, and default to Laravel-native DTO mapping or Doctrine's native hydrators.

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.
dbravoan/dbcms-admin-theme-dbcms
dbravoan/dbcms-theme-db-cyber
dbravoan/dbcms-blocks-basic
dbravoan/dbcms-module-content-audit
dbravoan/dbcms-module-ai-assistant
paygate-to/paygate-php
padosoft/askmydocs-connector-base
defstudio/supercharged-carbon
bernskioldmedia/laravel-matomo
bernskioldmedia/laravel-harvest
bernskiold/laravel-data-scrubber
bernskiold/laravel-currency-converter
bernskiold/laravel-campaign-monitor
bernskioldmedia/laravel-autotranslate
siberfx/telegram-bot
roy-sandip/laravel-view-extended
gregsphotography/site-builder-core
roy-sandip/laravel-view
anodyne/blade-fluentui-icons
webx-ui/module-catalog-collections