Releases: fbarrento/data-factory
Releases · fbarrento/data-factory
v1.1.0
Immutable
release. Only release title and notes can be modified.
Changed
- BREAKING: Moved
HasDataFactorytrait toFBarrento\DataFactory\Concerns\HasDataFactory- Update imports:
use FBarrento\DataFactory\Concerns\HasDataFactory; - This follows Laravel's convention of placing traits in a
Concernssubdirectory
- Update imports:
Added
- Complete Laravel Cloud API examples with deployment status enum
DeploymentStatusenum example in advanced documentation- Enhanced documentation showing enum usage in factories
Full Changelog: v1.0.0...v1.1.0
v1.0.0 - Initial Release
Immutable
release. Only release title and notes can be modified.
Data Factory v1.0.0
First stable release of Data Factory - A powerful, type-safe test data factory library for PHP.
Features
Core Functionality
- ✅ Factory pattern for PHP objects and arrays
- ✅ Faker integration for realistic fake data generation
- ✅ States for reusable variations
- ✅ Sequences for alternating values across instances
- ✅ Nested factories for complex object graphs
- ✅ Full PHP 8.4 enum support with
randomElement() - ✅
HasDataFactorytrait for easy factory integration - ✅
ArrayFactoryfor type-safe array generation
Quality & Compatibility
- ✅ 100% test coverage (57 tests, 185 assertions)
- ✅ PHPStan level max with 100% type coverage
- ✅ PHP 8.2, 8.3, and 8.4 compatibility
- ✅ Laravel Pint for code formatting
- ✅ Rector for automated refactoring
- ✅ PEST for unit testing
Documentation
- ✅ Complete README with quick start guide
- ✅ Detailed documentation for all features
- ✅ Real-world examples
- ✅ Roadmap for future features
Installation
composer require fbarrento/data-factory --devQuick Start
use FBarrento\DataFactory\Factory;
class UserFactory extends Factory
{
protected string $dataObject = User::class;
public function definition(): array
{
return [
'name' => $this->fake->name(),
'email' => $this->fake->email(),
];
}
}
// Create a single user
$user = UserFactory::new()->make();
// Create multiple users
$users = UserFactory::new()->count(10)->make();See the documentation for more details.