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(); } /**