From c700adee17008662dbb7d1cb02908a6f09cdaad4 Mon Sep 17 00:00:00 2001 From: wikichua Date: Wed, 13 Nov 2013 10:13:44 +0800 Subject: [PATCH] Update README.md Request to add alternative set up for Mongo Eloquent --- README.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/README.md b/README.md index 0ac8a39d7..e8667afc8 100644 --- a/README.md +++ b/README.md @@ -69,6 +69,26 @@ Tell your model to use the MongoDB model and set the collection (alias for table Everything else works just like the original Eloquent model. Read more about the Eloquent on http://laravel.com/docs/eloquent +Alternative Eloquent Setting +---------------------------- + + 'aliases' => array(... + 'Moloquent' => 'Jenssegers\Mongodb\Model', + ); + + class MyModel extends Moloquent { + + protected $collection = 'mycollection'; + + } + + Add + + protected $connection = 'mongodb'; + + in the MyModel if you have multiple database connections and do not want to overwrite the primary database connection. + + Query Builder -------------