Support the ongoing development of Laravel.io →
Database Eloquent Packages

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:

https://packagist.org/packages/laravel/dbfactory

Last updated 3 years ago.
0

Thanks for sharing, jcwatson11!

I'll keep this in mind when I need such functionality.

Last updated 3 years ago.
0

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. :)

Last updated 3 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

jcwatson11 jcwatson11 Joined 10 Mar 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2025 Laravel.io - All rights reserved.