public function disable($name)
    {
        // Check if exists
        if (!$this->downloaded($name)) {
            throw new Exceptions\HookNotFoundException("Hook [{$name}] not found.");
        }

        if (!$this->installed($name)) {
            throw new Exceptions\HookNotInstalledException("Hook [{$name}] not installed.");
        }

        if (!$this->enabled($name)) {
            throw new Exceptions\HookNotEnabledException("Hook [{$name}] not enabled.");
        }

        $hook = $this->hook($name);

        $hook->loadJson();

        event(new Events\DisablingHook($hook));

        $this->hooks[$name]->update(['enabled' => false]);

        $this->remakeJson();

        event(new Events\DisabledHook($hook));
    }
public function disable($name)
    {
        // Check if exists
        if (!$this->downloaded($name)) {
            throw new Exceptions\HookNotFoundException("Hook [{$name}] not found.");
        }

        if (!$this->installed($name)) {
            throw new Exceptions\HookNotInstalledException("Hook [{$name}] not installed.");
        }

        if (!$this->enabled($name)) {
            throw new Exceptions\HookNotEnabledException("Hook [{$name}] not enabled.");
        }

        $hook = $this->hook($name);

        $hook->loadJson();

        event(new Events\DisablingHook($hook));

        $this->hooks[$name]->update(['enabled' => false]);

        $this->remakeJson();

        event(new Events\DisabledHook($hook));
    }
public function disable ( $ name ) { // Check if exists if ( ! $ this -> downloaded ( $ name ) ) { throw new Exceptions \ HookNotFoundException ( "Hook [{$name}] not found." ) ; } if ( ! $ this -> installed ( $ name ) ) { throw new Exceptions \ HookNotInstalledException ( "Hook [{$name}] not installed." ) ; } if ( ! $ this -> enabled ( $ name ) ) { throw new Exceptions \ HookNotEnabledException ( "Hook [{$name}] not enabled." ) ; } $ hook = $ this -> hook ( $ name ) ; $ hook -> loadJson ( ) ; event ( new Events \ DisablingHook ( $ hook ) ) ; $ this -> hooks [ $ name ] -> update ( [ 'enabled' => false ] ) ; $ this -> remakeJson ( ) ; event ( new Events \ DisabledHook ( $ hook ) ) ; }
Disable a hook.

@param $name

@throws \Larapack\Hooks\Exceptions\HookNotFoundException
@throws \Larapack\Hooks\Exceptions\HookNotEnabledException
@throws \Larapack\Hooks\Exceptions\HookNotInstalledException
Disable a hook .