diff --git a/app/Console/Commands/Plugin/DisablePluginCommand.php b/app/Console/Commands/Plugin/DisablePluginCommand.php new file mode 100644 index 000000000..b6a179409 --- /dev/null +++ b/app/Console/Commands/Plugin/DisablePluginCommand.php @@ -0,0 +1,38 @@ +argument('id') ?? $this->choice('Plugin', Plugin::pluck('name', 'id')->toArray()); + + /** @var ?Plugin $plugin */ + $plugin = Plugin::where('id', $id)->first(); + + if (!$plugin) { + $this->error('Plugin does not exist!'); + + return; + } + + if (!$plugin->canDisable()) { + $this->error("Plugin can't be disabled!"); + + return; + } + + Plugins::disablePlugin($plugin); + + $this->info('Plugin disabled.'); + } +}