/**
  * Handle the command.
  *
  * @param Kernel     $console
  * @param Dispatcher $events
  */
 public function handle(Kernel $console, Dispatcher $events, ModuleRepositoryInterface $modules)
 {
     $this->module->fire('uninstalling');
     $options = ['--addon' => $this->module->getNamespace()];
     $console->call('migrate:reset', $options);
     $console->call('streams:destroy', ['namespace' => $this->module->getSlug()]);
     $console->call('streams:cleanup');
     $modules->uninstall($this->module);
     $this->module->fire('uninstalled');
     $events->fire(new ModuleWasUninstalled($this->module));
 }
 /**
  * Handle the command.
  *
  * @param Kernel                    $console
  * @param AddonManager              $manager
  * @param Dispatcher                $dispatcher
  * @param ModuleRepositoryInterface $modules
  * @return bool
  */
 public function handle(Kernel $console, AddonManager $manager, Dispatcher $dispatcher, ModuleRepositoryInterface $modules)
 {
     $this->module->fire('installing');
     $options = ['--addon' => $this->module->getNamespace(), '--force' => true];
     $console->call('migrate:refresh', $options);
     $modules->install($this->module);
     $manager->register();
     if ($this->seed) {
         $console->call('db:seed', $options);
     }
     $this->module->fire('installed');
     $dispatcher->fire(new ModuleWasInstalled($this->module));
     return true;
 }
 /**
  * Handle the command.
  *
  * @param ModuleRepositoryInterface $modules
  * @param Dispatcher                $events
  * @return bool
  */
 public function handle(ModuleRepositoryInterface $modules, Dispatcher $events)
 {
     $modules->disable($this->module);
     $events->fire(new ModuleWasDisabled($this->module));
     return true;
 }