File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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
3840Once the Capsule instance has been registered. You may use it like so:
You can’t perform that action at this time.
0 commit comments