Commit 0c3a8e7e authored by Jens Segers's avatar Jens Segers

Merge pull request #522 from kieranajp/patch-1

Update installation instructions for L5 and Lumen
parents e2bc57c3 fde367ca
...@@ -28,18 +28,32 @@ For Laravel 5, install the latest stable version using composer: ...@@ -28,18 +28,32 @@ For Laravel 5, install the latest stable version using composer:
composer require jenssegers/mongodb composer require jenssegers/mongodb
``` ```
And add the service provider in `config/app.php`:
```php
Jenssegers\Mongodb\MongodbServiceProvider::class,
```
For Laravel 4.2, use version `~2.0`: For Laravel 4.2, use version `~2.0`:
``` ```
composer require jenssegers/mongodb ~2.0 composer require jenssegers/mongodb ~2.0
``` ```
Add the service provider in `app/config/app.php`: And add the service provider as follows in `app/config/app.php`:
```php ```php
'Jenssegers\Mongodb\MongodbServiceProvider', 'Jenssegers\Mongodb\MongodbServiceProvider',
``` ```
For usage with [Lumen](http://lumen.laravel.com), add the service provider in `bootstrap/app.php`. In this file, you will also need to enable Eloquent. You must however ensure that your call to `$app->withEloquent();` is **below** where you have registered the `MongodbServiceProvider`:
```php
$app->register('Jenssegers\Mongodb\MongodbServiceProvider');
$app->withEloquent();
```
The service provider will register a mongodb database extension with the original database manager. There is no need to register additional facades or objects. When using mongodb connections, Laravel will automatically provide you with the corresponding mongodb objects. The service provider will register a mongodb database extension with the original database manager. There is no need to register additional facades or objects. When using mongodb connections, Laravel will automatically provide you with the corresponding mongodb objects.
For usage outside Laravel, check out the [Capsule manager](https://github.com/illuminate/database/blob/master/README.md) and add: For usage outside Laravel, check out the [Capsule manager](https://github.com/illuminate/database/blob/master/README.md) and add:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment