Skip to content

Commit

Permalink
Merge pull request #447 from 090809/fix-model-factory-chaining
Browse files Browse the repository at this point in the history
fix(model factory chain): implode relation chains for bigger relations
  • Loading branch information
shalvah authored Mar 21, 2022
2 parents 3716561 + a7d52b9 commit edd0f21
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Tools/Utils.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit edd0f21

Please sign in to comment.