/** * Remove all of the event listeners. * * @return void */ public static function flushEventListeners() { if (!isset(static::$dispatcher)) { return; } $instance = new static(); foreach ($instance->getObservableEvents() as $event) { static::$dispatcher->forget("portonefive.meta-bag.{$event}: " . get_called_class()); } }
/** * Remove all of the event listeners for the observers. * * @return void */ public static function flushEventListeners() { if (!isset(static::$dispatcher)) { return; } $instance = new static(); $className = get_called_class(); foreach ($instance->getObservableEvents() as $event) { $event = $instance->getObservableKey($event); static::$dispatcher->forget("{$event}: {$className}"); } }
/** * Remove all of the event listeners for the model. * * @return void */ public static function flushEventListeners() { if (!isset(static::$dispatcher)) { return; } $instance = new static(); foreach ($instance->getObservableEvents() as $event) { static::$dispatcher->forget("eloquent.{$event}: " . static::class); } }
/** * @param $names * @return mixed */ public function forget($names) { $this->dispatcher->forget($names); }
/** * Remove all of the event listeners for the model. * * @return void */ public static function flushEventListeners() { if (!isset(static::$dispatcher)) { return; } $instance = new static(); foreach ($instance->getObservableEvents() as $event) { static::$dispatcher->forget("halcyon.{$event}: " . get_called_class()); } static::$eventsBooted = []; }