PHPackages                             jwhulette/factory-generator - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. jwhulette/factory-generator

ActiveLibrary[Database &amp; ORM](/categories/database)

jwhulette/factory-generator
===========================

Generate Laravel 8+ database factories

v2.0.0(3y ago)016[2 PRs](https://github.com/jwhulette/factory-generator/pulls)MITPHPPHP ^8.1|^8.2

Since Jun 6Pushed 2y ago2 watchersCompare

[ Source](https://github.com/jwhulette/factory-generator)[ Packagist](https://packagist.org/packages/jwhulette/factory-generator)[ Docs](https://github.com/jwhulette/factory-generator)[ GitHub Sponsors](https://github.com/jwhulette)[ RSS](/packages/jwhulette-factory-generator/feed)WikiDiscussions main Synced today

READMEChangelog (5)Dependencies (9)Versions (8)Used By (0)

Generate Laravel 9+ database factories
======================================

[](#generate-laravel-9-database-factories)

[![Latest Version on Packagist](https://camo.githubusercontent.com/0e399ecd49f4414d5b698cb4ad2900010f3e610d079a4e9d1fe82b4c3f5b685c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6a7768756c657474652f666163746f72792d67656e657261746f722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/jwhulette/factory-generator) [![Minimum PHP Version](https://camo.githubusercontent.com/7f91fd16f805b376c8b9137ddc479aabdc9f79d19807832f85606cb3b74409c4/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253345253344253230382e302d3838393242462e7376673f7374796c653d666c61742d737175617265)](https://php.net/) [![GitHub Workflow Status (with branch)](https://camo.githubusercontent.com/5e42891eaf7670fc6aa25bf45d3672fbe17be41dd6fe06627de5321e4b1a6066/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6a7768756c657474652f666163746f72792d67656e657261746f722f72756e2d74657374732e796d6c3f6272616e63683d6d61696e)](https://camo.githubusercontent.com/5e42891eaf7670fc6aa25bf45d3672fbe17be41dd6fe06627de5321e4b1a6066/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6a7768756c657474652f666163746f72792d67656e657261746f722f72756e2d74657374732e796d6c3f6272616e63683d6d61696e) [![Total Downloads](https://camo.githubusercontent.com/91973c10a6ce465df9c067358a8a0a3890590f7b2a63ef34ebda692121dd52b4/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6a7768756c657474652f666163746f72792d67656e657261746f722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/jwhulette/factory-generator)

---

[![](.github/images/Factory Generator.png)]()

---

The package allows you to generate Laravel model factories automatically from your models.

It uses the model's database connection to retrieve the column information so the package can be used with multiple databases.

---

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require jwhulette/factory-generator
```

You can publish the config file with:

```
php artisan vendor:publish --provider="Jwhulette\FactoryGenerator\FactoryGeneratorServiceProvider.php" --tag="factory-generator-config"
```

This is the contents of the published config file:

```
