public function enable($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\HookAlreadyEnabledException("Hook [{$name}] already enabled.");
        }

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

        $hook->loadJson();

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

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

        $this->remakeJson();

        event(new Events\EnabledHook($hook));
    }
public function enable($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\HookAlreadyEnabledException("Hook [{$name}] already enabled.");
        }

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

        $hook->loadJson();

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

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

        $this->remakeJson();

        event(new Events\EnabledHook($hook));
    }
public function enable ( $ 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 \ HookAlreadyEnabledException ( "Hook [{$name}] already enabled." ) ; } $ hook = $ this -> hook ( $ name ) ; $ hook -> loadJson ( ) ; event ( new Events \ EnablingHook ( $ hook ) ) ; $ this -> hooks [ $ name ] -> update ( [ 'enabled' => true ] ) ; $ this -> remakeJson ( ) ; event ( new Events \ EnabledHook ( $ hook ) ) ; }
Enable hook.

@param $name

@throws \Larapack\Hooks\Exceptions\HookNotFoundException
@throws \Larapack\Hooks\Exceptions\HookNotInstalledException
@throws \Larapack\Hooks\Exceptions\HookAlreadyEnabledException
Enable hook .