From 2a1764104f7c01ba64260b66ccd106816d66e3af Mon Sep 17 00:00:00 2001 From: Davy de Vries Date: Thu, 3 Feb 2022 12:29:39 +0100 Subject: [PATCH] Use message as default alias hash --- src/OpsGenie.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/OpsGenie.php b/src/OpsGenie.php index a606cbd..5bf49be 100644 --- a/src/OpsGenie.php +++ b/src/OpsGenie.php @@ -185,6 +185,10 @@ public function message(string $message) { $this->object['message'] = (config('opsgenie.prefix') ? '['.config('opsgenie.prefix').'] ' : '').$message; + if (!array_key_exists( 'alias', $this->object)) { + $this->object['alias'] = md5($this->object['message']); + } + return $this; } @@ -391,6 +395,10 @@ public function message(string $message) { $this->object['message'] = (config('opsgenie.prefix') ? '['.config('opsgenie.prefix').'] ' : '').$message; + if (!array_key_exists( 'alias', $this->object)) { + $this->object['alias'] = md5($this->object['message']); + } + return $this; }