Hey folks,
There are times when heavy model customization is required, and I want to access data without having to write the model files. So I created a factory library that can be used to quickly generate model files on the file system on the fly as I am writing the code that uses them.
Files are generated in the storage location of your choice, and then left there for you to modify if you want to.
It also supports setting custom connection names, table names, and relations.
I wonder if this library might be useful to any of you:
https://bitbucket.org/fhcode/laravel-dbfactory.git
I have about 98% code coverage in my unit tests, so I'm fairly certain it's ready to be beta tested by the community.
You can also find it at:
Thanks for sharing, jcwatson11!
I'll keep this in mind when I need such functionality.
Sure. Happy to be able to contribute. It has turned out pretty useful. Seems like there are a lot of factory type methods out there, but nothing suitable for creating Eloquent models on the fly without having to write much code.
Now there is. :)
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community