siteName = $siteName; $this->siteHost = $siteHost; $this->siteId = $siteId; } public function handle(): void { // Run the deployment command (which already handles Ansible) $exitCode = Artisan::call('deploy:static-site', [ 'name' => $this->siteName, 'host' => $this->siteHost, 'id' => $this->siteId, ]); if ($exitCode !== 0) { $output = Artisan::output(); // optional: capture for logs logger()->error("❌ deploy:static-site failed for {$this->siteName}", [ 'output' => $output, 'exit_code' => $exitCode, ]); throw new \RuntimeException("deploy:static-site failed with exit code $exitCode"); } logger()->info("✅ deploy:static-site successful for {$this->siteName}"); } }