From b9bc413b058304883f07d653eb223d4f2f5e515b Mon Sep 17 00:00:00 2001 From: Deon George Date: Wed, 13 Dec 2023 08:58:13 +1100 Subject: [PATCH] Fix for finding the TIC origin, it doesnt have a parent --- app/Models/File.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Models/File.php b/app/Models/File.php index 7cd30ba..f949197 100644 --- a/app/Models/File.php +++ b/app/Models/File.php @@ -203,7 +203,7 @@ class File extends Model public function getOriginAttribute(): Address { - return $this->path->sortBy('parent_id')->last(); + return $this->path->where('pivot.parent_id','=',NULL)->pop(); } /**