/** * 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->install($addon, $this->option('seed')); $this->info('The [' . $this->argument('addon') . '] module was installed.'); } if ($addon instanceof Extension) { $extensions->install($addon, $this->option('seed')); $this->info('The [' . $this->argument('addon') . '] extension was installed.'); } }
/** * Handle the command. * * @param InstallAllModules $command */ public function handle(InstallAllModules $command) { foreach ($this->modules->all() as $module) { $this->manager->install($module, $command->getSeed()); } }
/** * Install a module. * * @param ModuleCollection $modules * @param ModuleManager $manager * @param $module */ public function module(ModuleCollection $modules, ModuleManager $manager, $module) { set_time_limit(5000); $manager->install($modules->get($module)); return response()->json(true); }