The Event class has a "forget" method that's not in the docs that might work for this (https://github.com/laravel/framework/blob/4.2/src/Illuminate/Events/Dispatcher.php#L333). I haven't tested it, but this should work
$model->getEventDispatcher()->forget("eloquent.updated: ClassNameHere");
Thanks for that, looks very useful :)
What's the opposite of forget(..)
, to use when adding the listeners back afterwards?
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community