Skip to content

Releases: fbarrento/data-factory

v1.1.0

11 Nov 09:34
Immutable release. Only release title and notes can be modified.

Choose a tag to compare

Changed

  • BREAKING: Moved HasDataFactory trait to FBarrento\DataFactory\Concerns\HasDataFactory
    • Update imports: use FBarrento\DataFactory\Concerns\HasDataFactory;
    • This follows Laravel's convention of placing traits in a Concerns subdirectory

Added

  • Complete Laravel Cloud API examples with deployment status enum
  • DeploymentStatus enum example in advanced documentation
  • Enhanced documentation showing enum usage in factories

Full Changelog: v1.0.0...v1.1.0

v1.0.0 - Initial Release

11 Nov 08:35
Immutable release. Only release title and notes can be modified.

Choose a tag to compare

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()
  • HasDataFactory trait for easy factory integration
  • ArrayFactory for 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 --dev

Quick 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.