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

Eloquent Mongodb Repository Laravel Package

nilportugues/eloquent-mongodb-repository

A repository layer for Eloquent MongoDB models in Laravel, wrapping query logic behind a clean, testable interface. Handles CRUD, filtering, and pagination so your models stay lean and data access stays consistent.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Build vs. buy for the persistence layer. This package is a thin repository abstraction over Eloquent-style MongoDB models. It answers a real architectural question — "do we hard-couple our domain code to Eloquent/Mongo, or put an interface in front of it?" — but it answers it as a reference design, not as a dependency you should ship.
  • Data-store optionality on the roadmap. A repository interface in front of Mongo is what lets you later swap to Postgres/MySQL (or to the official mongodb/laravel-mongodb driver) without rewriting domain logic. If a roadmap item is "de-risk our MongoDB bet," the pattern is worth a spike; this specific package is not.
  • Testability strategy. Repository boundaries enable in-memory or fixture-backed fakes in unit tests instead of hitting a live Mongo instance in CI. This is the most defensible day-one justification for the layer.
  • Multi-store / polyglot persistence use cases. If a feature needs relational data alongside document data, the repository contract is the seam that makes that tractable for a small team.
  • Explicitly not supported: it is not a driver, an ODM, or an aggregation-pipeline helper. It does not solve schema evolution, transactions, or data migration. Don't let it be positioned as such.

When to Consider This Package

Consider it only as source material to fork or copy when:

  • You are already on a legacy jenssegers/laravel-mongodb stack on PHP 7.x and need a drop-in base repository class to standardize existing code.
  • You want a worked example of the interface shape (find/findAll/create/update/delete/paginate) before writing your own.
  • You have an internal tool with low blast radius and no security or support obligations.

Look elsewhere — and plan to write ~1–2 days of code instead — when:

  • You are on PHP 8+ / Laravel 9+. A package last released March 2016 will not have kept pace with framework contracts, PHP typing, or the driver's move to the official mongodb/laravel-mongodb.
  • You need maintenance, security patching, or any support expectation. 18 stars, 0 dependents, no release in ~9 years means no community safety net and no reviewer pool. Adopting it is taking on a fork-you-own liability.
  • You need aggregation pipelines, transactions, change streams, or connection pooling — out of scope.
  • Your team would be adopting the repository pattern purely by reflex. If there is one model and one store, the abstraction is overhead; YAGNI applies.

How to Pitch It (Stakeholders)

To executives: This is a small, MIT-licensed convenience library from 2016 that has been effectively abandoned — 18 stars, no downstream dependents, no maintenance. It is not a strategic dependency and should not enter the stack. Its value to us is entirely in the pattern it demonstrates: a clean seam between business logic and the database, which buys us the option to change data stores later. MIT licensing means the ~small surface area is freely reimplementable in-house at roughly one to two engineer-days.

To engineering: Treat it as a reference implementation, not a dependency. Read the repository interface, write our own against the current official MongoDB Laravel driver, and own the code. This gives us the abstraction benefit without inheriting a nine-year-old, untested dependency that will break on the next PHP or Laravel upgrade. Recommendation: no-go on adoption; go on the pattern, scoped as a small internal spike with the interface under our control.

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.
pharaonic/laravel-notification-dependencies
beautinow/translug
dev-brainiac/bot-cloaked
octoberrain/html
octoberrain/extension
octoberrain/exception
octoberrain/contracts
frankyso/ipaymu
3mdikram/worldmoneywords
snowsoft/config
itmosoft/laravel-subscriptions
larva/laravel-ai-qwen
adachsoft/api-version-bundle
cgv/localized-resource
noith/settings
kda/laravel-package
kda/filament-dynamic-navigation
bypersoft/signbox
pairus/product-data
fayne/laravel-filament-cms-core