PHPackages                             matrix98/laravel\_doctrine\_odm - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. matrix98/laravel\_doctrine\_odm

ActiveLibrary[Database &amp; ORM](/categories/database)

matrix98/laravel\_doctrine\_odm
===============================

Doctrine ODM wrapper for Laravel

1.5.2(9mo ago)02.1k1MITPHPPHP ^8.0

Since Jun 5Pushed 9mo ago1 watchersCompare

[ Source](https://github.com/matrix2305/laravel-doctrine-odm)[ Packagist](https://packagist.org/packages/matrix98/laravel_doctrine_odm)[ RSS](/packages/matrix98-laravel-doctrine-odm/feed)WikiDiscussions main Synced 2d ago

READMEChangelog (10)Dependencies (2)Versions (12)Used By (0)

LaravelDoctrineODM
==================

[](#laraveldoctrineodm)

This library provides a Doctrine ODM wrapper for Laravel.

Installation
------------

[](#installation)

The suggested installation method is via [composer](https://getcomposer.org/):

```
composer require "matrix98/laravel_doctrine_odm:~1.0.0"
```

1. Add MongoDB configuration parameters in 'config/database.php' ('connection' array index child) :

```
'mongodb'   => [
            'driver'        => 'mongodb',
            'dsn'           => 'mongodb://'.env('DB_HOST'),
            'username' => env('DB_USERNAME'),
            'password' => env('DB_PASSWORD'),
            'port' => env('DB_PORT', '27017'),
            'database'      => env('DB_DATABASE'), // Default DB to perform queries against (not authenticate against)
            'retryConnect'  => 2, // Number of connection retry attempts before failing (doctrine feature)
            'retryQuery'    => 1, // Number of query retry attempts before failing (doctrine feature)
            'options'       => [
                // mapped to MongoClient $options
                'connectTimeoutMS'  => 1000, // Connection attempt timeout (milliseconds)
                'wTimeoutMS'        => 2500, // DB write attempt timeout (milliseconds)
                'socketTimeoutMS'   => 10000, // Client side socket timeout (milliseconds)
                'w'                 => 'majority', // Default write concern (normally w=1)
                'readPreference'    => 'primaryPreferred', // Default read preference
            ],
            'driverOptions' => [ // mapped to MongoClient $driverOptions (e.g. for SSL stream context)

            ]
        ],
```

2. Publish Laravel service provider:

```
php artisan vendor:publish --provider=LaravelDoctrineODM\ServiceProviders\IdeHelperServiceProvider
```

Using
-----

[](#using)

Example to get DocumentManager instance with dependency injection:

```
    use Doctrine\ODM\MongoDB\DocumentManager;

    class TestRepository {
        protected DocumentManager $dm;

        public function __construct(DocumentManager $dm)
        {
            $this->dm = $dm;
        }
    }
```

Example with DocumentManager facade:

```
use LaravelDoctrineODM\Facades\DocumentManager;

$sm = DocumentManager::getSchemaManager();
```

###  Health Score

40

—

FairBetter than 88% of packages

Maintenance56

Moderate activity, may be stable

Popularity19

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~151 days

Recently: every ~377 days

Total

11

Last Release

289d ago

PHP version history (2 changes)1.0.0PHP ^7.4|^8.0

1.5.2PHP ^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/ab1906a38c537f55dcbdb4bef7a1e1737a4c784c741627dabb72976e04fd916d?d=identicon)[zstevovich](/maintainers/zstevovich)

![](https://www.gravatar.com/avatar/10d069e47ef621e2f7348facfc7e181925b2d0906a554dd6f4caa69ecdb8e0a8?d=identicon)[matrix2305](/maintainers/matrix2305)

---

Top Contributors

[![matrix2305](https://avatars.githubusercontent.com/u/62420807?v=4)](https://github.com/matrix2305 "matrix2305 (38 commits)")

---

Tags

laraveldoctrineodmmongodbmongo

### Embed Badge

![Health badge](/badges/matrix98-laravel-doctrine-odm/health.svg)

```
[![Health](https://phpackages.com/badges/matrix98-laravel-doctrine-odm/health.svg)](https://phpackages.com/packages/matrix98-laravel-doctrine-odm)
```

###  Alternatives

[mmucklo/queue-bundle

Symfony2/3/4/5 Queue Bundle (for background jobs) supporting Mongo (Doctrine ODM), Mysql (and any Doctrine ORM), RabbitMQ, Beanstalkd, Redis, and ... {write your own}

120839.8k](/packages/mmucklo-queue-bundle)[doctrine/doctrine-mongo-odm-module

Laminas Module which provides Doctrine MongoDB ODM functionality

86676.6k35](/packages/doctrine-doctrine-mongo-odm-module)[leroy-merlin-br/mongolid

Easy, powerful and ultrafast ODM for PHP and MongoDB.

11234.3k4](/packages/leroy-merlin-br-mongolid)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
