Hey I saw you fixed this, or worked around it, on another forum, but I've had the same issue with factories. Part of the problem is when calling ->each() on a model vs. a collection.
For example you can recreate this with the following:
App\User::find(1)->each(function($u){});
Just make sure when you use a factory and are using each after a make/create call that it is returning a collection vs a single model.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community