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.'); } }