The problem is that Faker instance after latest commits (testing on 2.3.1) is Builders private property and we always get new Builder instances, so used values for attributes aren't shared.
public static function create($name, array $attributes = [])
{
return (new static)->getBuilder()->create($name, $attributes);
}
public function getBuilder()
{
return new Builder($this->databaseProvider(), $this->factories());
}
FakerAdapter (array notation) usage isn't completely affected because it share the same faker but not with simultaneous usage of user defined Closures so if we want to keep uniques then it should be reused, maybe as property in FactoriesLoader or Definition or as before in Factory?
Hey, @JeffreyWay this #90 issue isn't completely resolved, it still affects user Closures.
That is if you use consequent calls to static create, then it can still fail As an example, let's say we call it like this
Where Website factory is:
The chances are there will be uniques collision.
The problem is that Faker instance after latest commits (testing on 2.3.1) is Builders private property and we always get new Builder instances, so used values for attributes aren't shared.
FakerAdapter (array notation) usage isn't completely affected because it share the same faker but not with simultaneous usage of user defined Closures so if we want to keep uniques then it should be reused, maybe as property in FactoriesLoader or Definition or as before in Factory?
This is still regression to version 2.1