Skip to content

Commit 0c3a8e7

Browse files
committed
Merge pull request #522 from kieranajp/patch-1
Update installation instructions for L5 and Lumen
2 parents e2bc57c + fde367c commit 0c3a8e7

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

README.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,18 +28,32 @@ For Laravel 5, install the latest stable version using composer:
2828
composer require jenssegers/mongodb
2929
```
3030

31+
And add the service provider in `config/app.php`:
32+
33+
```php
34+
Jenssegers\Mongodb\MongodbServiceProvider::class,
35+
```
36+
3137
For Laravel 4.2, use version `~2.0`:
3238

3339
```
3440
composer require jenssegers/mongodb ~2.0
3541
```
3642

37-
Add the service provider in `app/config/app.php`:
43+
And add the service provider as follows in `app/config/app.php`:
3844

3945
```php
4046
'Jenssegers\Mongodb\MongodbServiceProvider',
4147
```
4248

49+
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`:
50+
51+
```php
52+
$app->register('Jenssegers\Mongodb\MongodbServiceProvider');
53+
54+
$app->withEloquent();
55+
```
56+
4357
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.
4458

4559
For usage outside Laravel, check out the [Capsule manager](https://github.com/illuminate/database/blob/master/README.md) and add:

0 commit comments

Comments
 (0)