diff --git a/src/Stache/Repositories/CollectionTreeRepository.php b/src/Stache/Repositories/CollectionTreeRepository.php index 099fa46eee..df6c5dc382 100644 --- a/src/Stache/Repositories/CollectionTreeRepository.php +++ b/src/Stache/Repositories/CollectionTreeRepository.php @@ -3,6 +3,8 @@ namespace Statamic\Stache\Repositories; use Statamic\Contracts\Structures\CollectionTree as TreeContract; +use Statamic\Contracts\Structures\Tree; +use Statamic\Facades\Stache as StacheFacade; use Statamic\Stache\Stache; use Statamic\Structures\CollectionTree; @@ -20,4 +22,16 @@ public static function bindings() TreeContract::class => CollectionTree::class, ]; } + + public function save(Tree $tree) + { + $result = parent::save($tree); + + StacheFacade::store('entries') + ->store($tree->collection()->handle()) + ->resolveIndexes() + ->each->update(); + + return $result; + } }