option('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->isInstalled()) { $this->error('Plugin is already installed!'); return; } Plugins::installPlugin($plugin); $this->info('Plugin installed and enabled.'); } }