protected function triggerHook($hook, $image)
    {
        if (is_callable($hook)) {
            $hook($image);
        }

        // We assume that the user is passing the hook class name
        if (is_string($hook)) {
            $instance = app($hook);
            $instance->handle($image);
        }
    }
protected function triggerHook($hook, $image)
    {
        if (is_callable($hook)) {
            $hook($image);
        }

        // We assume that the user is passing the hook class name
        if (is_string($hook)) {
            $instance = app($hook);
            $instance->handle($image);
        }
    }
protected function triggerHook ( $ hook , $ image ) { if ( is_callable ( $ hook ) ) { $ hook ( $ image ) ; } // We assume that the user is passing the hook class name if ( is_string ( $ hook ) ) { $ instance = app ( $ hook ) ; $ instance -> handle ( $ image ) ; } }
This will try to trigger the hook depending on the user definition.

@param $hook
@param $image

@throws \Exception
This will try to trigger the hook depending on the user definition .