Closed gbrock closed 9 years ago
Yep, the problem is the closure.
Use without the closure and it works.
In the meantime, you can use release 2.1
+1
The problem is actually because of changed design: "Get the generator stuff out of the Factory and Builder classes" as added FactoriesLoader::normalizeDefinitions is resolving user defined Closures only once after loading factories and not before building new entity.
+1 - this issue is really annoying.
Is it possible to just call the factory method every time I want to create a user? That way the data is randomised on each call - rather than just once?
i.e. it currently doesnt just affect $faker
- it also affects basic PHP functions like rand()
.
@h-collector's temporary solution works: load 2.1 in your composer.json:
"laracasts/testdummy": "2.1",
The issue with php functions like rand
persists in 2.3.2
The following code throws constraint violations on
email
andusername
, but works when only 1 row is generated:Seems like it isn't generating a new value on each faker call...?