Wire::removeHook PHP Method

removeHook() public method

To have a hook function remove itself within the hook function, say this is your hook function: function(HookEvent $event) { $event->removeHook(null); // remove self }
public removeHook ( string | null $hookId )
$hookId string | null
    public function removeHook($hookId)
    {
        if (!empty($hookId) && strpos($hookId, ':')) {
            list($hookClass, $priority, $method) = explode(':', $hookId);
            if (empty($hookClass)) {
                unset($this->localHooks[$method][$priority]);
            } else {
                unset(self::$staticHooks[$hookClass][$method][$priority]);
            }
        }
        return $this;
    }