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 Lazy Json Odm Laravel Package

vuryss/doctrine-lazy-json-odm

Adds lazy-loading JSON fields to Doctrine MongoDB ODM documents, so large JSON blobs stay unserialized until accessed. Keeps hydration fast and memory low while preserving a simple typed API for reading and updating nested JSON data.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Build vs. buy for large JSON payload storage. This package lets Doctrine persist JSON documents while hydrating nested nodes lazily, so a request that touches one field of a 2 MB webhook/API payload doesn't pay to decode the whole tree. That is a non-trivial hydration layer to hand-roll; the realistic comparison is "adopt a small ODM" vs. "spend 2–4 engineer-weeks building and maintaining a bespoke lazy-decoder plus mapping layer."
  • Feature scoping for ingestion-heavy surfaces. Directly relevant if the roadmap includes third-party API mirroring, webhook archives, CMS/page-builder content, event-sourcing snapshots, or audit trails where payloads are write-once, read-sometimes, and structurally variable. It is not relevant to core transactional domain models that want real columns, foreign keys, and indexes.
  • Roadmap sequencing against the PHP upgrade. v3.0.0 is a hard fork in the road: it requires PHP 8.5 and adds Symfony 8.0 coverage (retaining 7.4 LTS). Adoption of v3 is therefore gated on the platform's PHP 8.5 migration, not on any product need. v2.x remains the answer for any service on PHP ≤ 8.4. Treat the PHP 8.5 upgrade as the dependency that unlocks this capability, and sequence the feature accordingly.
  • Architecture standardization. If the org is Doctrine-centric (Symfony-first services, DBAL, migrations), this fits the grain of the stack. If the org is Eloquent-first Laravel, this is an outlier dependency that adds a second persistence paradigm — a decision that should be made deliberately, not per-feature.
  • Risk budgeting for a single-maintainer dependency. Small, focused, low-activity package with an aggressive platform floor. Acceptable for a bounded, non-critical read path with a pinned version and a documented exit; not acceptable as the storage substrate for a revenue-critical system without an internal fallback plan.

When to Consider This Package

Consider it when all of the following hold:

  • The runtime is on, or imminently moving to, PHP 8.5 (v3), or you are content to pin v2.x on PHP 8.2–8.4 and forgo v3.
  • You have Doctrine in the stack already, or are willing to introduce it alongside Eloquent for this specific bounded context.
  • The dominant data shape is large, nested, schema-flexible JSON that is read partially far more often than it is fully traversed.
  • The hot path has a measured problem — decode cost, memory ceiling, or payload size — rather than an assumed one.
  • You can pin a version, tolerate a single-maintainer bus factor, and define a rollback to plain json columns or object storage if the package stalls.

Look elsewhere when:

  • Payloads are small or always fully consumed — native json columns plus Laravel's AsArrayObject/array casts, or spatie/laravel-data, solve this with far less surface area.
  • The data actually wants relational modeling, joins, aggregation, or referential integrity — this package is the wrong tool and will be a migration liability later.
  • You need enterprise support, SLAs, CVE response commitments, or a multi-maintainer project.
  • You are pinned below PHP 8.5 and unwilling to run v2 — the v3 line is simply unavailable to you.
  • A managed document store (MongoDB, DynamoDB, Postgres jsonb with GIN indexes) already fits the query patterns and the team's operational competency.

How to Pitch It (Stakeholders)

To executives: We're evaluating a small open-source library that changes how we store large JSON payloads — instead of decoding an entire document to read one field, we decode only what's used. The business case is engineering time: it replaces a hydration layer we'd otherwise build and own, at the cost of one dependency. Two caveats worth your attention: the newest version (3.0.0) requires PHP 8.5 exclusively, so it lands on our PHP upgrade timeline rather than our product timeline, and the project has a single maintainer, so we'd pin the version and keep an escape hatch. Recommendation: approve a bounded pilot on one non-critical read path, not org-wide adoption.

To engineering: v3.0.0 is a breaking release — PHP 8.5 only, Symfony 8.0 added to the test matrix, Symfony 7.4 LTS retained, dependency bumps throughout. There are no new features beyond platform support. Practical guidance: stay on v2.x for any service below PHP 8.5 and do not plan a v3 bump until the 8.5 migration is scheduled; when it is, budget the bump as part of that migration rather than as a separate initiative. Before adopting either line, spike it against a real payload — measure memory and latency on partial reads versus a plain json column — and confirm the Doctrine integration co-exists cleanly with our Eloquent models. Pin exact versions, and document the fallback (raw JSON column, or object storage with an on-demand fetch) so an abandoned upstream isn't an incident.

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.
skyraptor/chatter
edlugz/sasapay
abbasudo/artisan-route
mirvan/ippanel
ignibyte/aic-framework
glavweb/data-schema-bundle
glavweb/datagrid-bundle
tacticmedia/scim-server
uni-method/frame
neika-ai/sdk
adachsoft/php-code-style
pharaonic/laravel-notification-dependencies
beautinow/translug
dev-brainiac/bot-cloaked
octoberrain/html
octoberrain/extension
octoberrain/exception
octoberrain/contracts
adachsoft/api-version-bundle
cgv/localized-resource