jenssegers/mongodb
This package brings MongoDB support to Laravel's Eloquent model and query builder, using the original Laravel API and methods so you can keep the same fluent syntax. Formerly jenssegers/mongodb, it is now mongodb/laravel-mongodb and supports Laravel 10.x as a drop-in replacement.
Primary decision: persistence architecture for the data layer. This package is the deciding lever when we ask "does this workload belong in a document store, or do we stay on Postgres/MySQL?" It lets us answer that per-domain instead of per-application, because a model can move to MongoDB without rewriting controllers, policies, or serialization — the Eloquent contract is preserved.
embedsOne/embedsMany, plus new auto-embedding) mean one read instead of four joins. This shortens the "model the domain → ship the feature" loop.mongodb/mongodb, or maintaining an abandoned fork. This is now owned by MongoDB, Inc. (renamed from jenssegers/mongodb to mongodb/laravel-mongodb), releases are GPG-signed, and it tracks Laravel's own semantics as the reference implementation. Building this in-house is a multi-quarter maintenance tax for zero differentiation._score sorting) ship in the same package. That can retire 2–3 third-party integrations and their security-review surface.Adopt when most of these hold:
Look elsewhere (or push back) when:
HasSchemaVersion helps, but it's a pattern, not a governance tool.)jsonb plus indexes covers most of the "flexible schema" ask without a second datastore, second backup strategy, and second on-call runbook. Introducing MongoDB only to store JSON is a net negative.PHPLARA), not GitHub, and general questions route to MongoDB's commercial support channels. Fine for most teams; a gap if we need contractual SLAs without an Atlas agreement.Two data caveats before this reaches a decision doc: the "0 dependents" figure is a dataset artifact, not a signal — the predecessor package is one of the most-installed Laravel extensions in existence, so treat dependency risk as low and verify via Packagist before quoting numbers. Likewise, the maturity signal here is "README + releases," so the diligence we still owe is our own: a spike on index strategy, a read on the upgrade cadence (frequent minor releases, some with breaking changes — 5.9.0 dropped framework versions), and confirmation that our Laravel/PHP versions are in the supported matrix.
One-liner for executives: This is the official MongoDB-maintained Eloquent driver for Laravel. It lets us put document-shaped, high-write workloads on MongoDB without retraining the team or rewriting application code — a scoped, reversible bet rather than a platform migration.
What it buys us: faster delivery on features with evolving or nested data (catalogs, content, preferences, event payloads); one read instead of several joins for aggregate-shaped screens; and the ability to introduce MongoDB for a single bounded context while the transactional core stays relational. It also consolidates infrastructure — filesystem, cache, locks, queues, and search all come from the same dependency.
Cost and effort: MIT-licensed, no per-seat cost; the real spend is engineering time (a spike plus one bounded service), plus Atlas if we want Search/Vector Search and managed operations. Incremental cost is meaningfully lower than a relational re-architecture, and the blast radius is one service.
Risk, honestly stated: this is a second datastore — second backup/restore path, second on-call runbook, second set of index and capacity decisions. Transactions are weaker than a relational engine. Migration tooling is not at parity. And it is only cheap if we scope it to data that actually wants to be a document; used as a JSON bucket, it's a net negative versus Postgres jsonb.
What we're asking for: a timeboxed spike on one bounded context with go/no-go criteria agreed up front (read latency, operational effort, and whether the domain's queries stay aggregate-shaped). If those criteria fail, we walk away having spent days, not a quarter — and the relational core is untouched either way.
For engineering: the pull is that it mirrors illuminate/database by design — when behavior diverges, the project aligns to Laravel rather than inventing a MongoDB dialect. Pin the major version, check the compatibility matrix against our Laravel/PHP baseline before committing, and treat document modeling and index design as the real skills gap to close in the spike.
How can I help you explore Laravel packages today?