public function uninstall($name, $delete = false, $unmigrate = true, $unseed = true, $unpublish = true)
    {
        // Check if installed
        if (!$this->installed($name)) {
            throw new Exceptions\HookNotInstalledException("Hook [{$name}] is not installed.");
        }

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

        $hook->loadJson();

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

        if ($this->enabled($name)) {
            event(new Events\DisablingHook($hook));

            // Some logic could later be placed here

            event(new Events\DisabledHook($hook));
        }

        if ($unseed) {
            $this->unseedHook($hook);
        }

        if ($unmigrate) {
            $this->unmigrateHook($hook);
        }

        if ($unpublish) {
            $this->unpublishHook($hook);
        }

        $this->runComposer([
            'command'  => 'remove',
            'packages' => [$name],
        ]);

        $hooks = $this->hooks()->where('name', '!=', $name);
        $this->hooks = $hooks;

        $this->remakeJson();

        event(new Events\UninstalledHook($name));

        if ($delete && $hook->isLocal()) {
            $this->filesystem->deleteDirectory(base_path("hooks/{$name}"));
        }
    }
public function uninstall($name, $delete = false, $unmigrate = true, $unseed = true, $unpublish = true)
    {
        // Check if installed
        if (!$this->installed($name)) {
            throw new Exceptions\HookNotInstalledException("Hook [{$name}] is not installed.");
        }

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

        $hook->loadJson();

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

        if ($this->enabled($name)) {
            event(new Events\DisablingHook($hook));

            // Some logic could later be placed here

            event(new Events\DisabledHook($hook));
        }

        if ($unseed) {
            $this->unseedHook($hook);
        }

        if ($unmigrate) {
            $this->unmigrateHook($hook);
        }

        if ($unpublish) {
            $this->unpublishHook($hook);
        }

        $this->runComposer([
            'command'  => 'remove',
            'packages' => [$name],
        ]);

        $hooks = $this->hooks()->where('name', '!=', $name);
        $this->hooks = $hooks;

        $this->remakeJson();

        event(new Events\UninstalledHook($name));

        if ($delete && $hook->isLocal()) {
            $this->filesystem->deleteDirectory(base_path("hooks/{$name}"));
        }
    }
public function uninstall ( $ name , $ delete = false , $ unmigrate = true , $ unseed = true , $ unpublish = true ) { // Check if installed if ( ! $ this -> installed ( $ name ) ) { throw new Exceptions \ HookNotInstalledException ( "Hook [{$name}] is not installed." ) ; } $ hook = $ this -> hook ( $ name ) ; $ hook -> loadJson ( ) ; event ( new Events \ UninstallingHook ( $ hook ) ) ; if ( $ this -> enabled ( $ name ) ) { event ( new Events \ DisablingHook ( $ hook ) ) ; // Some logic could later be placed here event ( new Events \ DisabledHook ( $ hook ) ) ; } if ( $ unseed ) { $ this -> unseedHook ( $ hook ) ; } if ( $ unmigrate ) { $ this -> unmigrateHook ( $ hook ) ; } if ( $ unpublish ) { $ this -> unpublishHook ( $ hook ) ; } $ this -> runComposer ( [ 'command' => 'remove' , 'packages' => [ $ name ] , ] ) ; $ hooks = $ this -> hooks ( ) -> where ( 'name' , '!=' , $ name ) ; $ this -> hooks = $ hooks ; $ this -> remakeJson ( ) ; event ( new Events \ UninstalledHook ( $ name ) ) ; if ( $ delete && $ hook -> isLocal ( ) ) { $ this -> filesystem -> deleteDirectory ( base_path ( "hooks/{$name}" ) ) ; } }
Uninstall a hook.

@param $name
@param $keep boolean

@throws \Larapack\Hooks\Exceptions\HookNotInstalledException
Uninstall a hook .