diff --git a/src/Illuminate/Database/Eloquent/Factories/Factory.php b/src/Illuminate/Database/Eloquent/Factories/Factory.php index d43a22296ab2..e8c25101361b 100644 --- a/src/Illuminate/Database/Eloquent/Factories/Factory.php +++ b/src/Illuminate/Database/Eloquent/Factories/Factory.php @@ -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); }); }); } @@ -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); }); }); }