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.
Consider it when all of the following hold:
json columns or object storage if the package stalls.Look elsewhere when:
json columns plus Laravel's AsArrayObject/array casts, or spatie/laravel-data, solve this with far less surface area.jsonb with GIN indexes) already fits the query patterns and the team's operational competency.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.
How can I help you explore Laravel packages today?