From 189e4ef230bbda28b722461b97fc6f400c97d4c7 Mon Sep 17 00:00:00 2001 From: James Collins Date: Mon, 24 Jul 2023 12:36:34 +1000 Subject: [PATCH] set null value to empty string --- app/Models/AnalyticsSession.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/app/Models/AnalyticsSession.php b/app/Models/AnalyticsSession.php index f86ef9b..3e7b653 100644 --- a/app/Models/AnalyticsSession.php +++ b/app/Models/AnalyticsSession.php @@ -21,6 +21,17 @@ class AnalyticsSession extends Model 'ended_at' ]; + /** + * Set the "useragent" attribute. + * + * @param mixed $value + * @return void + */ + public function setUseragentAttribute($value) + { + $this->attributes['useragent'] = $value !== null ? $value : ''; + } + /** * Returns the related requests for this session. *