src/Support/Concerns/Observable.php
public static function flushEventListeners(): void
    {
        if (! isset(static::$dispatcher)) {
            return;
        }

        $instance = new static();
        $className = static::class;

        foreach ($instance->getObservableEvents() as $event) {
            $event = $instance->getObservableKey($event);

            static::$dispatcher->forget("{$event}: {$className}");
        }
    }
public static function flushEventListeners(): void
    {
        if (! isset(static::$dispatcher)) {
            return;
        }

        $instance = new static();
        $className = static::class;

        foreach ($instance->getObservableEvents() as $event) {
            $event = $instance->getObservableKey($event);

            static::$dispatcher->forget("{$event}: {$className}");
        }
    }
public static function flushEventListeners ( ) : void { if ( ! isset ( static :: $ dispatcher ) ) { return ; } $ instance = new static ( ) ; $ className = static :: class ; foreach ( $ instance -> getObservableEvents ( ) as $ event ) { $ event = $ instance -> getObservableKey ( $ event ) ; static :: $ dispatcher -> forget ( "{$event}: {$className}" ) ; } }
Remove all of the event listeners for the observers.

@return void
Remove all of the event listeners for the observers .