From 2a50a1d795e4ae82a5e7a0d1830998eecb9af415 Mon Sep 17 00:00:00 2001 From: Deon George Date: Tue, 3 Oct 2023 09:11:08 +1100 Subject: [PATCH] When we dont have session() details return a blank string instead of null --- app/Models/Address.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Models/Address.php b/app/Models/Address.php index d103833..bfb3585 100644 --- a/app/Models/Address.php +++ b/app/Models/Address.php @@ -859,6 +859,6 @@ class Address extends Model */ public function session(string $type): ?string { - return ($this->exists && ($x=$this->system->sessions->where('id',$this->zone_id)->first())) ? $x->pivot->{$type} : NULL; + return ($this->exists && ($x=$this->system->sessions->where('id',$this->zone_id)->first())) ? ($x->pivot->{$type} ?: '') : NULL; } }