From 8aad1d247e257e75462c6c0f796c199ff4db1f62 Mon Sep 17 00:00:00 2001 From: "Ralph J. Smit" <59207045+ralphjsmit@users.noreply.github.com> Date: Wed, 5 Feb 2025 17:55:05 +0100 Subject: [PATCH] Update Builder.php --- src/Illuminate/Database/Eloquent/Builder.php | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/src/Illuminate/Database/Eloquent/Builder.php b/src/Illuminate/Database/Eloquent/Builder.php index 806e3b8d1ab..5669d67f54c 100755 --- a/src/Illuminate/Database/Eloquent/Builder.php +++ b/src/Illuminate/Database/Eloquent/Builder.php @@ -2190,20 +2190,6 @@ public function onClone(Closure $callback) return $this; } - /** - * Invoke the "on clone" modification callbacks. - * - * @return static - */ - public function applyOnCloneCallbacks() - { - foreach ($this->onCloneCallbacks as $onCloneCallback) { - $onCloneCallback($this); - } - - return $this; - } - /** * Force a clone of the underlying query builder when cloning. * @@ -2212,7 +2198,9 @@ public function applyOnCloneCallbacks() public function __clone() { $this->query = clone $this->query; - - $this->applyOnCloneCallbacks(); + + foreach ($this->onCloneCallbacks as $onCloneCallback) { + $onCloneCallback($this); + } } }