Wire::addHookAfter PHP Method

addHookAfter() public method

This is the same as calling addHook with the 'after' option set the $options array. If you are hooking a procedural function, you may omit the $toObject and instead just call via: $this->addHookAfter($method, 'function_name');
public addHookAfter ( string $method, object | null | callable $toObject, string $toMethod = null, array $options = [] ) : string
$method string Method name to hook into, NOT including the three preceding underscores May also be Class::Method for same result as using the fromClass option.
$toObject object | null | callable Object to call $toMethod from, Or null if $toMethod is a function outside of an object, Or function|callable if $toObject is not applicable or function is provided as a closure.
$toMethod string Method from $toObject, or function name to call on a hook event. Optional.
$options array See self::$defaultHookOptions at the beginning of this class. Optional.
return string A special Hook ID that should be retained if you need to remove the hook later
    public function addHookAfter($method, $toObject, $toMethod = null, $options = array())
    {
        $options['after'] = true;
        if (!isset($options['before'])) {
            $options['before'] = false;
        }
        return $this->addHook($method, $toObject, $toMethod, $options);
    }