From 45140885c0c5cb70631e9918b9f21e1cc8393f4d Mon Sep 17 00:00:00 2001 From: Michael Aerni Date: Fri, 30 Aug 2024 12:44:02 -0400 Subject: [PATCH] Fix tests. need to find another way to set faker. --- src/Factories/Factory.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/Factories/Factory.php b/src/Factories/Factory.php index bce5657..81b9e72 100644 --- a/src/Factories/Factory.php +++ b/src/Factories/Factory.php @@ -158,6 +158,11 @@ protected function getExpandedAttributes(): array return $this->expandAttributes($this->getRawAttributes()); } + /** + * TODO: Overriding of attributes doesn't work anymore. + * Need to find a way to see if there's a site attribute in the states, then set the faker to that site. + * And then evaluate all the states. + */ protected function getRawAttributes(): array { $definition = $this->states->reduce(function (array $carry, $state) { @@ -168,9 +173,7 @@ protected function getRawAttributes(): array return array_merge($carry, $state($carry)); }, $this->definition()); - $this->faker = $this->withFaker(Arr::get($definition, 'site')); - - return array_merge($definition, $this->definition()); + return $definition; } protected function expandAttributes(array $definition)