argument('url'); // @phpstan-ignore-line $confirm = $this->option('confirm'); if (!filter_var($url, FILTER_VALIDATE_URL)) { $this->error('Invalid URL provided.'); return self::FAILURE; } if (!$confirm) { if (!$this->confirm("Are you sure you want to unsubscribe from webhook URL: $url?")) { $this->info('Operation cancelled.'); return self::SUCCESS; } } $this->info('Unsubscribing from webhook...'); $this->line("URL: $url"); try { $result = $api->unsubscribe($url); if ($result->success) { $this->info('✅ Successfully unsubscribed from webhook!'); return self::SUCCESS; } else { $this->error('❌ Failed to unsubscribe from webhook.'); $this->line("Response: $result->message"); return self::FAILURE; } } catch (Throwable $e) { Log::error("Webhook unsubscribe error: {$e->getMessage()}", [ 'exception' => $e, ]); $this->error("❌ Webhook unsubscribe error: {$e->getMessage()}"); return self::FAILURE; } } }