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

Mongodb Laravel Package

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.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

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.
  • The fork's 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

  1. What upstream commit is broutard/mongodb forked from, and what is the diff versus jenssegers/laravel-mongodb / mongodb/laravel-mongodb?
  2. Which Laravel and PHP versions does the composer.json actually allow? Does it have tests and CI?
  3. Is there an internal owner and a stated reason for forking (a needed patch, a pin, a licensing constraint)? If "none," this is not a dependency — it is a liability.
  4. Does the workload genuinely require schema flexibility, or would JSON columns on the existing RDBMS solve 80% of it at zero operational cost?
  5. Is ext-mongodb available and version-managed in every deployment target?
  6. What is the data migration and rollback plan if the document store is abandoned?

Integration Approach

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

  • Eloquent-dependent ecosystem packages (Nova, Telescope, Spatie Permission, auditing packages) assume SQL and will break or need per-package forks.
  • RefreshDatabase / migrations do not apply; testing needs a dedicated trait plus a disposable Mongo instance in CI.
  • Queue, session, and cache Mongo drivers exist upstream but are not guaranteed here — do not assume parity.
  • Laravel's Auth via a Mongo user provider works but is non-standard; prefer keeping identity data in the relational store.

Sequencing

  1. Validate the data-model need (spike, one week) against a JSON-column alternative.
  2. Stand up a throwaway project and prove installation on the exact target PHP/Laravel matrix.
  3. Prototype one non-critical bounded context (e.g., activity feed) behind an interface.
  4. If proceeding, fork upstream into an org-controlled repo with CI, dependency scanning, and a named owner.
  5. Only then move to a production context, with dual-write and a documented cutover.

Operational Impact

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

  • Boot-time fatality: missing/mismatched ext-mongodb → application won't start; frequently discovered in production when a base image changes.
  • Silent wire-protocol drift: a stale driver against a newer MongoDB server yields intermittent, hard-to-diagnose query failures.
  • Schema drift: no migrations means no authoritative record of document shape; validation must be enforced in code or via MongoDB JSON Schema, and is usually neglected.
  • Performance cliff: a query that works on 10k documents with client-side join emulation falls over at 1M.
  • Upgrade deadlock: Laravel major upgrade blocked solely by the driver's constraint.
  • Composer resolution conflict: another package pins 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.

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.
payerurl/telegrambot-crypto-payment-instant-payout
dskripchenko/laravel-hybrid-search
riorizkyrainey/lara-ced
mehedimi/static-vel
zharp/zharp
nonsapiens/bigquery-model-sync
lgu-bayambang-ict-office/lgu-laravel-development-standards
andydefer/laravel-support
se7enxweb/flysystem
lampwick/laravel
jeslage/statamic-emojis
micahdshackelford/rmap-laravel
draftsmaninc/draftsman
square-bit/laravel-volition
himito/laravel-mailman
htinlynn/genius-helper
maco-studios/hephaestus
elmogy/larafast
xeviant/laravel-paystack
gorilladash/laravel-website-sdk