argument('id') ?? $this->choice('Plugin', Plugin::pluck('name', 'id')->toArray()); $plugin = Plugin::find($id); if (!$plugin) { $this->error('Plugin does not exist!'); return; } if (!$plugin->isInstalled()) { $this->error('Plugin is not installed!'); return; } $deleteFiles = $this->option('delete'); if ($this->input->isInteractive() && !$deleteFiles) { $deleteFiles = $this->confirm('Do you also want to delete the plugin files?'); } Plugins::uninstallPlugin($plugin, $deleteFiles); $this->info('Plugin uninstalled' . ($deleteFiles ? ' and files deleted' : '') . '.'); } }