Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. MongoDB
  3. laravel-mongodb

laravel-mongodb

MITPHP5.8.2

A MongoDB-based Eloquent model and Query builder for Laravel, extending the original Laravel API.

Visit WebsiteGitHubGitHub
7.1k stars1.4k forks0 contributors

What is laravel-mongodb?

Laravel MongoDB is a Laravel package that provides a MongoDB-based Eloquent model and Query Builder, allowing developers to use MongoDB as their database while retaining Laravel's Eloquent ORM syntax and features. It solves the problem of integrating MongoDB into Laravel applications without needing to learn a new API or rewrite existing database logic.

Target Audience

Laravel developers who want to use MongoDB as their database backend while maintaining the familiar Eloquent ORM and Query Builder workflows.

Value Proposition

Developers choose Laravel MongoDB because it offers seamless integration with Laravel's existing API, eliminating the need to learn a new query syntax or rewrite application code when switching to MongoDB. Its compatibility with Laravel's authentication, migrations, and schema operations provides a full-featured MongoDB experience within the Laravel ecosystem.

Overview

A MongoDB based Eloquent model and Query builder for Laravel (Moloquent)

Use Cases

Best For

  • Laravel applications requiring a NoSQL database backend
  • Projects transitioning from SQL databases to MongoDB without code changes
  • Building scalable applications with MongoDB and Laravel's Eloquent ORM
  • Using Laravel's authentication and migrations with MongoDB
  • Executing complex queries and aggregations in MongoDB via Laravel's Query Builder
  • Maintaining Eloquent model relationships and mutators with MongoDB collections

Not Ideal For

  • Applications requiring complex SQL joins and strict relational data integrity with foreign keys
  • Projects where full ACID compliance with multi-document transactions is non-negotiable
  • Teams preferring minimal abstraction and direct, low-level MongoDB driver access for performance tuning

Pros & Cons

Pros

Seamless Eloquent Integration

Extends Laravel's core classes, allowing use of identical Eloquent methods with MongoDB, as stated in the README for a consistent developer experience.

Full Query Builder Support

Enables complex queries and aggregations using Laravel's fluent syntax, maintaining API compatibility without learning a new query language.

Integrated Schema Management

Supports Laravel's schema builder and migrations for managing MongoDB collections and indexes, facilitating database operations within Laravel's workflow.

Authentication Compatibility

Works with Laravel's authentication system out-of-the-box, allowing MongoDB storage for user data without modifying auth logic.

Cons

MongoDB Feature Limitations

Some advanced MongoDB features may require raw queries, as the Eloquent abstraction can obscure native capabilities like geospatial indexes or change streams.

Performance Overhead

The abstraction layer introduces overhead compared to direct MongoDB driver usage, potentially affecting high-throughput applications that demand raw speed.

Version Dependency Complexity

Compatibility is tied to specific Laravel versions, requiring careful upgrades and referencing old package versions, as noted in the README for older Laravel support.

Frequently Asked Questions

Quick Stats

Stars7,074
Forks1,434
Contributors0
Open Issues38
Last commit1 day ago
CreatedSince 2013

Tags

#database-driver#eloquent#query-builder#orm#laravel#eloquent-orm#database-integration#mongo#nosql#laravel-framework#mongodb#laravel-package#php

Built With

M
MongoDB
P
PHP
L
Laravel

Links & Resources

Website

Included in

MongoDB2.6k
Auto-fetched 19 hours ago

Related Projects

Doctrine MongoDB ODMDoctrine MongoDB ODM

The Official PHP MongoDB ORM/ODM

Stars1,094
Forks511
Last commit1 day ago
MongoDBMongoDB

The Official MongoDB PHP driver

Stars922
Forks218
Last commit2 days ago
mongo-php-adaptermongo-php-adapter

:link: [Deprecated] Adapter to provide ext-mongo interface on top of mongo-php-library

Stars463
Forks131
Last commit1 year ago
yii-mongodbyii-mongodb

Yii 2 MongoDB extension

Stars332
Forks190
Last commit21 days ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub