From a7d52b9a58beec7741e141c0c34ce09fc998e952 Mon Sep 17 00:00:00 2001 From: pallam Date: Mon, 7 Mar 2022 14:13:05 +0300 Subject: [PATCH] fix(model factory chain): implode relation chains for bigger (more than 2 deepest relations chains) --- src/Tools/Utils.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Tools/Utils.php b/src/Tools/Utils.php index 8e9ae002..15077810 100644 --- a/src/Tools/Utils.php +++ b/src/Tools/Utils.php @@ -244,7 +244,7 @@ public static function getModelFactory(string $modelName, array $states = [], ar $factoryChain = empty($relationChain) ? call_user_func_array([$relationModel, 'factory'], []) - : Utils::getModelFactory($relationModel, $states, $relationChain); + : Utils::getModelFactory($relationModel, $states, [implode('.', $relationChain)]); if ($relationType === BelongsToMany::class) { $pivot = method_exists($factory, 'pivot' . $relationVector)