broutard/mongodb
A Laravel/PHP package that brings MongoDB into your applications, offering query building, model integration, and document handling so you can work with MongoDB collections using familiar Laravel-style syntax.
Architecture fit
The package is an Eloquent driver — it swaps Laravel's SQL grammar for a MongoDB query builder while preserving Model::find(), relationships, mutators, and casts. That is a genuine architectural win if the domain is document-shaped: product catalogs with heterogeneous attributes, event/audit logs, CMS content blocks, or user-generated payloads with variable schema. It is a poor fit as a wholesale replacement for the relational core — Eloquent's relationship layer emulates joins client-side, and belongsToMany, polymorphic pivots, and whereHas degrade badly at scale. The defensible pattern is a polyglot split: MySQL/Postgres for the transactional core (users, orders, billing), MongoDB for the flexible/peripheral bounded contexts.
Integration feasibility
Mechanically trivial: composer require broutard/mongodb, register the service provider, add a mongodb connection block, and set protected $connection = 'mongodb' on the relevant models. Real prerequisites are environmental, not code-level:
ext-mongodb PHP extension (not the legacy ext-mongo) must be present in every runtime, including CI, staging, and shared hosting — historically the #1 blocker.composer.json version constraints must resolve against the target Laravel and PHP versions. The "Moloquent" naming and description are lifted from the Laravel 4/5-era package, which strongly suggests a stale constraint set (e.g., illuminate/support: ~5.0) that will not install against Laravel 10/11 or PHP 8.2+.Technical risk — High
| Risk | Severity | Note |
|---|---|---|
| Staleness / abandonment | Critical | 0 stars, 0 dependents, no downstream validation; likely a personal fork pinned to an obsolete upstream commit |
| Supply-chain integrity | High | Unaudited diff from upstream; no provenance, no signed releases, no security contact |
| Laravel/PHP incompatibility | High | Probable illuminate/* and PHP version ceilings; upgrade path blocked |
| Patch lag | High | Upstream CVE and bug fixes must be manually merged by you |
| Attribution | Low | MIT requires retention of the original copyright notice — verify the fork did not strip it |
Key questions
broutard/mongodb forked from, and what is the diff versus jenssegers/laravel-mongodb / mongodb/laravel-mongodb?composer.json actually allow? Does it have tests and CI?ext-mongodb available and version-managed in every deployment target?Stack fit
Assume Laravel 10/11 on PHP 8.1+ unless proven otherwise — treat this fork as not fit until composer install succeeds in a clean throwaway project. The supported path for the same capability is the officially maintained mongodb/laravel-mongodb (MongoDB, Inc.), which tracks current Laravel/PHP releases, ships a security disclosure process, and has real dependents. A TPM recommendation here is straightforward: do not adopt the fork; adopt upstream, and if a specific patch is needed, carry it as a pinned fork you own with CI, not a zero-star artifact.
Migration path
If the intent is to replace jenssegers/laravel-mongodb, the change is largely mechanical — the model base class and namespace move (Jenssegers\Mongodb\Eloquent\Model → Broutard\Mongodb\Eloquent\Model), plus connection config. Same shape of change applies when moving from this fork to mongodb/laravel-mongodb. Budget as a search-and-replace across model classes plus a full regression pass on any query using where, orWhere, whereIn with nested document paths, and aggregation pipelines — those are where driver forks diverge semantically.
Compatibility
RefreshDatabase / migrations do not apply; testing needs a dedicated trait plus a disposable Mongo instance in CI.Auth via a Mongo user provider works but is non-standard; prefer keeping identity data in the relational store.Sequencing
Maintenance You inherit the maintenance burden in full. There is no release cadence, no changelog, no issue triage. Realistic cost is 1–3 engineer-days per quarter to merge upstream fixes and keep the fork building against new Laravel/PHP releases — plus unbudgeted spikes whenever Laravel ships a major. With the official package, that cost is externalized.
Support No vendor, no SLA, no CVE feed, no security contact. Vulnerability intelligence must be sourced from the upstream project and mapped to your fork manually. Incident response for a driver-level bug defaults to "patch it ourselves."
Scaling
The PHP driver's connection pooling handles concurrency well; MongoDB replica sets and sharding scale horizontally. The bottlenecks are almost always the ORM layer: emulated joins materializing large result sets in PHP, N+1 patterns through lazy-loaded relations, and unbounded document growth hitting the 16 MB BSON ceiling. Old driver versions may lack multi-document transactions — confirm ACID guarantees before committing to any cross-collection write path. Operationally you add a second datastore to run: replica set topology, backup/restore (mongodump or Atlas PITR), separate monitoring, and a second on-call runbook.
Failure modes
ext-mongodb → application won't start; frequently discovered in production when a base image changes.illuminate/* in a way the fork cannot satisfy.Ramp-up Engineers steeped in SQL will mis-model relationships and reach for joins that the driver fakes. Expect 2–4 weeks of onboarding friction for a mid-level team, plus permanent cognitive overhead from a dual-store architecture: two query languages, two debugging toolchains, two backup strategies. Weigh that against the feature value of schema flexibility before committing.
Verdict: reject as a production dependency. If MongoDB is warranted, adopt the officially maintained mongodb/laravel-mongodb; if a specific patch is needed, own a fork with CI and a named maintainer. The 0-star, 0-dependent signal is not a popularity contest — it is the absence of any evidence that this code installs, runs, or is maintained.
How can I help you explore Laravel packages today?