reedware/laravel-modern-factories
Composer 安装命令:
composer require --dev reedware/laravel-modern-factories
包简介
Adds modern Laravel Factories to older versions of Laravel
README 文档
README
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.
Usage of Laravel 7 and older is waning, but it ain't zero. Trying to upgrade? Maybe this package can help.
Table of Contents
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
- Larastan (requires Laravel 6.x or greater) or PHPStan (requires PHP 7.1 or greater)
- PHPUnit (requires PHP 5.3 or greater)
This package is meant to aid your investment in automated testing via 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 to keep moving forward with your legacy factories, but let's be real, that's not what you want either.
Installation
Install this package using composer:
composer require reedware/laravel-modern-factories
This package doesn't use any facades or service providers.
Versioning
This package targets the feature set of Laravel 8.x Eloquent 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:
| Package | Laravel | PHP |
|---|---|---|
| 1.x | 5.1 - 7.x | 5.5 - 7.4 |
| 2.x | 6.x - 7.x | 8.0 - 8.4 |
Usage
Refer to the Laravel 8.x Documentation on Eloquent 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
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.
reedware/laravel-modern-factories 适用场景与选型建议
reedware/laravel-modern-factories 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 1.56k 次下载、GitHub Stars 达 0, 最近一次更新时间为 2026 年 01 月 13 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「testing」 「laravel」 「factories」 「eloquent」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 reedware/laravel-modern-factories 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 reedware/laravel-modern-factories 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 reedware/laravel-modern-factories 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Testing Suite For Lumen like Laravel does.
HTTP client library
A library to generate application code based on database definition.
DotKernel hydrator component extending and customizing laminas-hydrator
DotKernel validator component extending and customizing laminas-validator
DotKernel filter component customizing and extending laminas-filter
统计信息
- 总下载量: 1.56k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 8
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-01-13
