From 34c9f932a30100910d389557606eeaf6fd9063b9 Mon Sep 17 00:00:00 2001 From: manavo Date: Wed, 26 Nov 2014 23:44:57 +0000 Subject: [PATCH] Fix webhooks error --- app/models/WebHook.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/models/WebHook.php b/app/models/WebHook.php index 1d6556c1..e5dddedc 100644 --- a/app/models/WebHook.php +++ b/app/models/WebHook.php @@ -47,7 +47,8 @@ public function fire($eventType, $data = null) { $startTime = microtime(true); - $request = $this->client->createRequest($this->requestMethod, $this->endpoint, [ + $client = new \GuzzleHttp\Client(); + $request = $client->createRequest($this->requestMethod, $this->endpoint, [ 'headers' => [ 'X-Cachet-Event' => $eventType, ], @@ -55,7 +56,7 @@ ]); try { - $response = $this->client->send($request); + $response = $client->send($request); } catch (\GuzzleHttp\Exception\ClientException $e) { // Do nothing with the exception, we want it. $response = $e->getResponse();