PHPackages                             mongator/laravel - 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. [Framework](/categories/framework)
4. /
5. mongator/laravel

ActiveLibrary[Framework](/categories/framework)

mongator/laravel
================

Provider to use Mongator with Laravel framework

04PHP

Since Jul 2Pushed 13y ago2 watchersCompare

[ Source](https://github.com/mongator/laravel)[ Packagist](https://packagist.org/packages/mongator/laravel)[ RSS](/packages/mongator-laravel/feed)WikiDiscussions master Synced 6d ago

READMEChangelogDependenciesVersions (1)Used By (0)

Mongator Laravel4 Provider [![Build Status](https://camo.githubusercontent.com/e0420b47d41df5c73e4ad06023e5854d60b048f1bd190cdea640d804f22374d5/68747470733a2f2f7472617669732d63692e6f72672f6d6f6e6761746f722f6c61726176656c2e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/mongator/laravel)
==========================================================================================================================================================================================================================================================================================================

[](#mongator-laravel4-provider-)

Provider for using Mongator with Laravel 4 framework

Requirements
------------

[](#requirements)

- PHP 5.3.x
- Laravel 4
- mongator/mongator

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

[](#installation)

Add `mongator/laravel` to your composer requirements, you can see [the package information on Packagist.](https://packagist.org/packages/mongator/laravel):

```
{
    "require": {
        "mongator/laravel": "dev-master"
    }
}
```

Now, run `composer update`

Once the package is installed, open your `app/config/app.php` configuration file and locate the `providers` key. Add the following line to the end:

```
    ...
    'Mongator\Laravel\MongatorServiceProvider',
    ...
```

Next, locate the `aliases` key and add the following lines:

```
    ...
    'Mondator'        => 'Mongator\Laravel\Facades\Mondator',
    'Mongator'        => 'Mongator\Laravel\Facades\Mongator',
    ...
```

Now just create a YAML config classes dir at your `app` folder:

```
mkdir app/schema/
```

Parameters
----------

[](#parameters)

- `connection_dsn` (default 'mongodb://localhost:27017'): database connection string
- `connection_database`: the database name
- `connection_name` (default 'default'): the name of the connection
- `models_output` (default 'app/models/'): output path of the classes
- `models_input` (default 'app/schema/'): A valid dir with YAML definitions of the config classes
- `metadata_class`: The metadata factory class name
- `logger` (default false): enable the query logger
- `extensions` (default Array()): array of extension instances

Usage
-----

[](#usage)

```
Route::get('/view', function() {
    $articleRepository = Mongator::getRepository('Article');
    $article = $articleRepository->findOneById($id);

    return View::make($article);
});
```

```
Route::get('/create', function() {
    $article = Mongator::create('Article');
    $article->setAuthor('John Doe');
    $article->setTitle('Lorem ipsum dolor sit amet, consectetur adipisicing elit.')
    $article->save();
});
```

> Remember, before using the models you must generate them. (You can use the command provided with this package.)

Commands
--------

[](#commands)

With this package you can find three useful commands, thought `php artisan`:

- `mongator:generate`: Processes config classes and generates the files of the classes.
- `mongator:_indexes`: Ensures the indexes of all repositories
- `mongator:fix`: Fixes all the missing references.

Tests
-----

[](#tests)

Tests are in the `tests` folder. To run them, you need PHPUnit. Example:

```
$ phpunit --configuration phpunit.xml.dist

```

License
-------

[](#license)

MIT, see [LICENSE](LICENSE)

###  Health Score

20

—

LowBetter than 12% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 96.4% 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.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1573114?v=4)[Máximo Cuadros](/maintainers/mcuadros)[@mcuadros](https://github.com/mcuadros)

---

Top Contributors

[![mcuadros](https://avatars.githubusercontent.com/u/1573114?v=4)](https://github.com/mcuadros "mcuadros (27 commits)")[![filiptc](https://avatars.githubusercontent.com/u/2487390?v=4)](https://github.com/filiptc "filiptc (1 commits)")

### Embed Badge

![Health badge](/badges/mongator-laravel/health.svg)

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

###  Alternatives

[nineinchnick/edatatables

Grid widget for the Yii Framework, wrapper for the DataTables jQuery plugin

173.2k](/packages/nineinchnick-edatatables)

PHPackages © 2026

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