diff --git a/src/BaseFactory.php b/src/BaseFactory.php index cf33afa..0e098ff 100644 --- a/src/BaseFactory.php +++ b/src/BaseFactory.php @@ -73,7 +73,7 @@ public function with(string $relatedModelClass, string $relationshipName, int $t $clone->relatedModelFactories = clone $clone->relatedModelFactories; $clone->relatedModelFactories[$relationshipName] ??= collect(); $clone->relatedModelFactories[$relationshipName] = $clone->relatedModelFactories[$relationshipName]->merge( - collect()->times($times, fn() => $this->getFactoryFromClassName($relatedModelClass)) + collect()->times($times, fn () => $this->getFactoryFromClassName($relatedModelClass)) ); return $clone; @@ -120,7 +120,7 @@ private function buildRelationsForModel(Model $model, string $creationType): Mod if (method_exists($relation, 'associate')) { $relatedModels = $factories->map->$creationType(); - $relatedModels->each(fn($related) => $relation->associate($related)); + $relatedModels->each(fn ($related) => $relation->associate($related)); if ($creationType === 'create') { $model->save();