plugin = $plugin; $this->action = $action; } public function uniqueId() { return $this->plugin->id; } /** * Execute the job. * * @return void */ public function handle(PluginRepository $pluginRepository) { match ($this->action) { 'install' => $pluginRepository->doInstall($this->plugin), 'update' => $pluginRepository->doUpdate($this->plugin), 'delete' => $pluginRepository->doDelete($this->plugin), default => throw new \InvalidArgumentException("Invalid action: " . $this->action) }; } }