Skip to content

Commit

Permalink
Revert "[11.x] Change scope for afterCreating and afterMaking cal…
Browse files Browse the repository at this point in the history
…lbacks (…"

This reverts commit 202422d.
  • Loading branch information
driesvints authored Jun 20, 2024
1 parent 02a0b5f commit b3b86a9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Illuminate/Database/Eloquent/Factories/Factory.php
Original file line number Diff line number Diff line change
Expand Up @@ -694,7 +694,7 @@ protected function callAfterMaking(Collection $instances)
{
$instances->each(function ($model) {
$this->afterMaking->each(function ($callback) use ($model) {
Closure::fromCallable($callback)->call($this, $model);
$callback($model);
});
});
}
Expand All @@ -710,7 +710,7 @@ protected function callAfterCreating(Collection $instances, ?Model $parent = nul
{
$instances->each(function ($model) use ($parent) {
$this->afterCreating->each(function ($callback) use ($model, $parent) {
Closure::fromCallable($callback)->call($this, $model, $parent);
$callback($model, $parent);
});
});
}
Expand Down

0 comments on commit b3b86a9

Please sign in to comment.