diff --git a/src/Structures/CollectionTree.php b/src/Structures/CollectionTree.php index 328a93b4a2..776af56e37 100644 --- a/src/Structures/CollectionTree.php +++ b/src/Structures/CollectionTree.php @@ -14,9 +14,15 @@ class CollectionTree extends Tree implements TreeContract { + private $structureCache; + public function structure() { - return Blink::once('collection-tree-structure-'.$this->handle(), function () { + if ($this->structureCache) { + return $this->structureCache; + } + + return $this->structureCache = Blink::once('collection-tree-structure-'.$this->handle(), function () { return Collection::findByHandle($this->handle())->structure(); }); }