From b3b86a97b10743cc0e9e72dd505752781e18b089 Mon Sep 17 00:00:00 2001 From: Dries Vints Date: Thu, 20 Jun 2024 12:50:24 +0200 Subject: [PATCH] =?UTF-8?q?Revert=20"[11.x]=20Change=20scope=20for=20`afte?= =?UTF-8?q?rCreating`=20and=20`afterMaking`=20callbacks=20(=E2=80=A6"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 202422d4e6d91fbc301c8f3501f37c58b4fc5326. --- src/Illuminate/Database/Eloquent/Factories/Factory.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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); }); }); }