From 950287f1ad2b142202e5cb1d69c4dcb046362a65 Mon Sep 17 00:00:00 2001 From: Wilmer Arambula Date: Sun, 29 Jun 2025 08:55:32 -0400 Subject: [PATCH] refactor: Remove unnecessary node refresh in `beforeInsert()` method of `NestedSetsBehavior` class. --- src/NestedSetsBehavior.php | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/NestedSetsBehavior.php b/src/NestedSetsBehavior.php index 2cc3d77..4dfee70 100644 --- a/src/NestedSetsBehavior.php +++ b/src/NestedSetsBehavior.php @@ -363,10 +363,6 @@ public function beforeDelete(): void */ public function beforeInsert(): void { - if ($this->node?->getIsNewRecord() === false) { - $this->node->refresh(); - } - $nodeLeftValue = $this->node?->getAttribute($this->leftAttribute) ?? 0; $nodeRightValue = $this->node?->getAttribute($this->rightAttribute) ?? 0;