Support the ongoing development of Laravel.io →
Database Eloquent
Last updated 2 years ago.
0

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");
Last updated 2 years ago.
0

Thanks for that, looks very useful :)

What's the opposite of forget(..), to use when adding the listeners back afterwards?

Last updated 2 years ago.
0

It's listen(..) isn't it.

Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

mattpotts mattpotts Joined 14 Sep 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.