Skip to content

Commit

Permalink
Update Builder.php
Browse files Browse the repository at this point in the history
  • Loading branch information
ralphjsmit committed Feb 5, 2025
1 parent befb277 commit 8aad1d2
Showing 1 changed file with 4 additions and 16 deletions.
20 changes: 4 additions & 16 deletions src/Illuminate/Database/Eloquent/Builder.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand All @@ -2212,7 +2198,9 @@ public function applyOnCloneCallbacks()
public function __clone()
{
$this->query = clone $this->query;

$this->applyOnCloneCallbacks();

foreach ($this->onCloneCallbacks as $onCloneCallback) {
$onCloneCallback($this);
}
}
}

0 comments on commit 8aad1d2

Please sign in to comment.