/** * Execute the console command. * * @param ModuleManager $manager * @param ModuleCollection $modules */ public function fire(ModuleManager $manager, ModuleCollection $modules) { /* @var Module $module */ $module = $modules->get($this->argument('module')); $manager->uninstall($module); $this->info(trans($module->getName()) . ' uninstalled successfully!'); }
/** * Uninstall an addon. * * @param AddonCollection $addons * @param ModuleManager $modules * @param ExtensionManager $extensions * @param $addon * @return \Illuminate\Http\RedirectResponse */ public function uninstall(AddonCollection $addons, ModuleManager $modules, ExtensionManager $extensions, $addon) { /* @var Addon $addon */ $addon = $addons->get($addon); if ($addon instanceof Module) { $modules->uninstall($addon); } elseif ($addon instanceof Extension) { $extensions->uninstall($addon); } $this->messages->success('module::message.uninstall_addon_success'); return $this->redirect->back(); }
/** * Execute the console command. * * @param AddonCollection $addons * @param ModuleManager $modules * @param ExtensionManager $extensions */ public function fire(AddonCollection $addons, ModuleManager $modules, ExtensionManager $extensions) { if (!($addon = $addons->get($this->argument('addon')))) { $this->error('The [' . $this->argument('addon') . '] could not be found.'); } if ($addon instanceof Module) { $modules->uninstall($addon); $this->info('The [' . $this->argument('addon') . '] module was uninstalled.'); } if ($addon instanceof Extension) { $extensions->uninstall($addon); $this->info('The [' . $this->argument('addon') . '] extension was uninstalled.'); } }