Bump. I also want to define my model factories in my package directory where my models live, not in my test app.
The framework basically combines any .php files in the database/factories folder.
To streamline things a little bit, I got rid of ModelFactory.php and created things like:
/database
/factories
UserFactory.php
ProductFactory.php
Each of those files simply contains the $factory->define(...);
line.
As for putting them elsewhere.. I don't know.. but all the magic seems to happen in Illuminate/Database/Eloquent/Factory.php in the construct function.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community