Closed vatsake closed 10 months ago
Hi @vatsake!
This is an error in the documentation, the correct method name is Container::getDispatcher()
:
https://ldaprecord.com/docs/core/v3/models/#events
use LdapRecord\Container;
use LdapRecord\Models\Events\Creating;
$dispatcher = Container::getDispatcher();
$dispatcher->listen(Creating::class, function ($event) {
$model = $event->getModel();
});
I've just pushed a fix in the docs for this! Let me know if you encounter further issues and I can re-open. 👍
Environment:
Describe the bug: Ehm.. Am I doing something wrong here?
php artisan optimize throws error