PHPackages                             krajcik/data-builder - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. krajcik/data-builder

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

krajcik/data-builder
====================

Data generator based on database structure of your project.

v1.0.2(1y ago)010.2k↓37.5%1BSD-3-ClausePHPPHP &gt;=8.0CI passing

Since Aug 4Pushed 1y ago1 watchersCompare

[ Source](https://github.com/krajcikondra/data-builder)[ Packagist](https://packagist.org/packages/krajcik/data-builder)[ RSS](/packages/krajcik-data-builder/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (8)Versions (15)Used By (1)

krajcik/data-builder
====================

[](#krajcikdata-builder)

Package helps to write test data for tests using data builders which package generate specifically for your project. By default, are all data filled randomly with option change one or more properties.

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

[](#installation)

```
composer require krajcik/data-builder

```

Using
-----

[](#using)

### Configuration and generate

[](#configuration-and-generate)

```
    use \Krajcik\DataBuilder\Dto\Configuration;

    $targetFolder = '../tests/generated'; // specify some path in your project where you want generate builders

    $configuration = new Configuration(
        $targetFolder,
        'localhost',
        'myTestDb',
        'root',
        'root',
    );

```

### Define builders which want generate

[](#define-builders-which-want-generate)

Define all doctrine entities for which you want generate builder

```
    use \Krajcik\DataBuilder\Dto\BuilderToGenerateDto;

    $builderToGenerate = [
        BuilderToGenerateDto::createFromDoctrineEntity('Api\Contact\Entity\Contact'),
        BuilderToGenerateDto::createFromDoctrineEntity('Api\Contact\Entity\ContactData'),
    ];

```

### Generate builders

[](#generate-builders)

```
    use \Krajcik\DataBuilder\BuilderCompiler;

    $compiler = new BuilderCompiler($configuration);
    $compiler->compile($builderToGenerate);

```

### Using builders

[](#using-builders)

```
    $builderFactory = new \Tests\Generated\Builder\BuilderFactory($entityManager);

    $contactData = $builderFactory->createContactDataBuilder()
        ->withFirstName('John')
        ->withLastName('Doe')
        ->buildAndSave();
    // $contactData is saved entity (Api\Contact\Entity\ContactData) from your project which you can use now in your test case

```

###  Health Score

35

—

LowBetter than 80% of packages

Maintenance43

Moderate activity, may be stable

Popularity24

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 95% 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 ~15 days

Recently: every ~28 days

Total

14

Last Release

455d ago

Major Versions

v0.1.10 → v1.0.02024-11-01

### Community

Maintainers

![](https://www.gravatar.com/avatar/abcd971025e7368820d6f85446fd352e22c514b91aa52b81f87ca9d94268f158?d=identicon)[krajcikondra](/maintainers/krajcikondra)

---

Top Contributors

[![ondrejkrajcik-blogic](https://avatars.githubusercontent.com/u/150679625?v=4)](https://github.com/ondrejkrajcik-blogic "ondrejkrajcik-blogic (19 commits)")[![krajcikondra](https://avatars.githubusercontent.com/u/7726222?v=4)](https://github.com/krajcikondra "krajcikondra (1 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/krajcik-data-builder/health.svg)

```
[![Health](https://phpackages.com/badges/krajcik-data-builder/health.svg)](https://phpackages.com/packages/krajcik-data-builder)
```

###  Alternatives

[verbb/formie

The most user-friendly forms plugin for Craft.

101372.9k40](/packages/verbb-formie)[blair2004/nexopos

The Free Modern Point Of Sale System build with Laravel, TailwindCSS and Vue.js.

1.2k2.3k](/packages/blair2004-nexopos)[solspace/craft-freeform

The most flexible and user-friendly form building plugin!

52664.9k12](/packages/solspace-craft-freeform)[crescat-io/saloon-sdk-generator

Simplified SDK Scaffolding for Saloon

13130.9k7](/packages/crescat-io-saloon-sdk-generator)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)

PHPackages © 2026

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