Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 63ed900

Browse files
committed
Merge pull request laravel#1768 from BigBlueHat/patch-2
updated README.md with working code order & objects
2 parents f2dacb5 + 3a48066 commit 63ed900

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

src/Illuminate/Database/README.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,19 @@ $capsule->addConnection([
2222
'prefix' => '',
2323
]);
2424
25-
// Setup the Eloquent ORM... (optional)
26-
$capsule->bootEloquent();
27-
2825
// Set the event dispatcher used by Eloquent models... (optional)
29-
$capsule->setEventDispatcher(...);
26+
use Illuminate\Events\Dispatcher;
27+
use Illuminate\Container\Container;
28+
$capsule->setEventDispatcher(new Dispatcher(new Container));
3029
3130
// Set the cache manager instance used by connections... (optional)
3231
$capsule->setCacheManager(...);
3332
3433
// Make this Capsule instance available globally via static methods... (optional)
3534
$capsule->setAsGlobal();
35+
36+
// Setup the Eloquent ORM... (optional; unless you've used setEventDispatcher())
37+
$capsule->bootEloquent();
3638
```
3739

3840
Once the Capsule instance has been registered. You may use it like so:

0 commit comments

Comments
 (0)