PHPackages                             reedware/laravel-modern-factories - 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. [Testing &amp; Quality](/categories/testing)
4. /
5. reedware/laravel-modern-factories

ActiveLibrary[Testing &amp; Quality](/categories/testing)

reedware/laravel-modern-factories
=================================

Adds modern Laravel Factories to older versions of Laravel

v2.1.1(4mo ago)0877↓16.7%MITPHPPHP &gt;=8.0CI passing

Since Jan 12Pushed 4mo agoCompare

[ Source](https://github.com/tylernathanreed/laravel-modern-factories)[ Packagist](https://packagist.org/packages/reedware/laravel-modern-factories)[ RSS](/packages/reedware-laravel-modern-factories/feed)WikiDiscussions 2.x Synced 1mo ago

READMEChangelogDependencies (11)Versions (9)Used By (0)

Laravel Modern Factories
========================

[](#laravel-modern-factories)

This package brings modern Laravel Factories (circa Laravel 8) to older versions of Laravel, with the aim of helping legacy applications update to modern Laravel.

[![Laravel Version](https://camo.githubusercontent.com/a78753612ab6e0544412f5705eb4ff58997e887d498abcf911227a7449936ebc/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c61726176656c2d352e31253246372e782d626c7565)](https://laravel.com/)[![PHP Version](https://camo.githubusercontent.com/072a2bcea5019b0ec0733d010d4e8474890fe6b8601b1970d191f2c66ddd529d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d352e35253246382e342d707572706c65)](https://php.net/)[![Build](https://github.com/tylernathanreed/laravel-modern-factories/actions/workflows/build.yml/badge.svg)](https://github.com/tylernathanreed/laravel-modern-factories/actions/workflows/build.yml)

**Usage of Laravel 7 and older is waning, but it ain't zero. Trying to upgrade? Maybe this package can help.**

[![Laravel Installs](docs/installs.png)](docs/installs.png)

Table of Contents
-----------------

[](#table-of-contents)

- [Introduction](#introduction)
- [Installation](#installation)
- [Versioning](#versioning)
- [Usage](#usage)

Introduction
------------

[](#introduction)

If you're still using Laravel 7 or older, you already know that it's high time to upgrade, but let's be real, there's probably some roadblocks in the way. One of the roadblocks I've been faced having confidence that I don't break anything when upgrading. There are a few tools to combat this:

- [Laravel Shift](https://laravelshift.com/)
- [Larastan](https://github.com/larastan/larastan) (requires Laravel 6.x or greater) or [PHPStan](https://github.com/phpstan/phpstan) (requires PHP 7.1 or greater)
- [PHPUnit](https://github.com/sebastianbergmann/phpunit) (requires PHP 5.3 or greater)

This package is meant to aid your investment in automated testing via [PHPUnit](https://github.com/sebastianbergmann/phpunit). When you're behind on your version of Laravel, you've got technical debt. Usually, upgrading your version of Laravel is a common blocker for multiple avenues of addressing your technical debt. That said, if you're paying down your technical debt by writing automated tests using legacy Laravel Factories, there's effectively a tax associated with every payment, as once you get to Laravel 8, you'll be pressured to upgrade to modern Laravel Factories. You can use [laravel/legacy-factories](https://github.com/laravel/legacy-factories) to keep moving forward with your legacy factories, but let's be real, that's not what you want either.

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

[](#installation)

Install this package using composer:

```
composer require reedware/laravel-modern-factories

```

This package doesn't use any facades or service providers.

Versioning
----------

[](#versioning)

This package targets the feature set of [Laravel 8.x Eloquent Factories](https://laravel.com/docs/8.x/database-testing#defining-model-factories). If you're on Laravel 8 or greater, don't use this package; just use the native Eloquent Factories.

The following Laravel and PHP versions are supported:

PackageLaravelPHP1.x5.1 - 7.x5.5 - 7.42.x6.x - 7.x8.0 - 8.4Usage
-----

[](#usage)

Refer to the [Laravel 8.x Documentation on Eloquent Factories](https://laravel.com/docs/8.x/database-testing#defining-model-factories). This package autoloads into the `Illuminate\Database\Eloquent\Factories` namespace (which isn't used prior to Laravel 8), so the documentation can be followed verbatim.

### Changes for 5.6 or Older

[](#changes-for-56-or-older)

The `new` and `for` keywords are not allowed as method names. You can use `newFactory` and `forModel` instead. Newer versions of PHP (7.0 or greater) can use the `new` and `for` methods as-is.

###  Health Score

39

—

LowBetter than 86% of packages

Maintenance78

Regular maintenance activity

Popularity19

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity44

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

8

Last Release

121d ago

Major Versions

v1.0.0 → v2.0.02026-01-13

v1.1.0 → v2.1.12026-01-17

PHP version history (2 changes)v1.0.0PHP &gt;=5.5

v2.0.0PHP &gt;=8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/6bfd8171901449cf1e05fa5db261a2f424abca5e26818ce54b95442de0661754?d=identicon)[tylernathanreed](/maintainers/tylernathanreed)

---

Top Contributors

[![tylernathanreed](https://avatars.githubusercontent.com/u/6486381?v=4)](https://github.com/tylernathanreed "tylernathanreed (63 commits)")

---

Tags

testinglaraveleloquentfactories

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/reedware-laravel-modern-factories/health.svg)

```
[![Health](https://phpackages.com/badges/reedware-laravel-modern-factories/health.svg)](https://phpackages.com/packages/reedware-laravel-modern-factories)
```

###  Alternatives

[larastan/larastan

Larastan - Discover bugs in your code without running it. A phpstan/phpstan extension for Laravel

6.4k43.5M5.2k](/packages/larastan-larastan)[timacdonald/log-fake

A drop in fake logger for testing with the Laravel framework.

4235.9M56](/packages/timacdonald-log-fake)[imanghafoori/eloquent-mockery

Allows you to design your tests in an independent manner.

127636.4k2](/packages/imanghafoori-eloquent-mockery)[sti3bas/laravel-scout-array-driver

Array driver for Laravel Scout

971.5M3](/packages/sti3bas-laravel-scout-array-driver)[illuminated/testing-tools

Laravel-specific Testing Helpers and Assertions.

5420.4k17](/packages/illuminated-testing-tools)[sofa/eloquent-testsuite

Helpers for fast and reliable UNIT tests for your Eloquent Models with PHPUnit

10104.7k](/packages/sofa-eloquent-testsuite)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
