PHPackages                             lulco/populator - 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. [Database &amp; ORM](/categories/database)
4. /
5. lulco/populator

ActiveLibrary[Database &amp; ORM](/categories/database)

lulco/populator
===============

Database fake data populator for PHP

1.3.0(1y ago)932.0k↓34.6%4MITPHPPHP ^7.4 || ^8.0

Since Dec 27Pushed 1y ago1 watchersCompare

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

READMEChangelogDependencies (6)Versions (6)Used By (0)

Populator
=========

[](#populator)

Allows populate fake data to your database

[![PHP unit](https://github.com/lulco/populator/workflows/PHPunit/badge.svg)](https://github.com/lulco/populator/actions?query=workflow%3APHPunit)[![PHPStan level](https://camo.githubusercontent.com/0101f0942b244ec08cb1404d5c1b7ac22f8f70eb5d730f43d7dff4a5b6a28508/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048505374616e2d6c6576656c3a253230352d627269676874677265656e2e737667)](https://github.com/lulco/populator/actions?query=workflow%3A%22PHP+static+analysis%22)[![PHP static analysis](https://github.com/lulco/populator/workflows/PHP%20static%20analysis/badge.svg)](https://github.com/lulco/populator/actions?query=workflow%3A%22PHP+static+analysis%22)[![SensioLabsInsight](https://camo.githubusercontent.com/9688b2fc36eee7ab9c531ab03510a981a49f04f395a2f7da66488d802c6d7ea2/68747470733a2f2f696e73696768742e73796d666f6e792e636f6d2f70726f6a656374732f31373935626335642d383036332d346336622d616233342d3133633963363134323136652f6d696e692e706e67)](https://insight.sensiolabs.com/projects/1795bc5d-8063-4c6b-ab34-13c9c614216e)[![Latest Stable Version](https://camo.githubusercontent.com/4f17036a67e3ea5525b14cf7d260252b190fb178ee86a1955e8418b93a2fe392/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6c756c636f2f706f70756c61746f722e737667)](https://packagist.org/packages/lulco/populator)[![Total Downloads](https://camo.githubusercontent.com/cfb410273ef0cd82e3291ce7374d10c72c11657b98150a43309e38ed7cbf6820/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6c756c636f2f706f70756c61746f722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/lulco/populator)[![PHP 7 supported](https://camo.githubusercontent.com/5e738198c8be3e25f1bd33d18ef6acb1620c81c5712b74e7bf82dcfd80ad0d92/687474703a2f2f7068703772656164792e74696d6573706c696e7465722e63682f6c756c636f2f706f70756c61746f722f6d61737465722f62616467652e737667)](https://travis-ci.org/lulco/populator)

The best feature of this library is AutomaticPopulatorCommand which populates data based on full database structure. It analyses database table tree and creates items for each table - leaves first.

```
// file bin/command.php

$database = new Populator\Database\Database('db_name', 'mysql:dbname=db_name;host=db_host', 'db_user', 'db_password');
$populator = new Populator\Command\AutomaticPopulatorCommand($database, ['phoenix_log', 'phinxlog', 'migration_log', 'versions', 'api_logs', 'api_tokens'], true, $columnNameAndTypeCallbacks);

$application = new Application();
$application->add($populator);
$application->run();
```

Run:

```
php bin/command.php populator:populate

```

With this setup, AutomaticPopulatorCommand will create 5 items in all leaf-tables, than 25 for 2nd level, and 125 for all next levels. It can be changed by parameters `$countBase` and `$maxCountPerTable` of AutomaticPopulatorCommand.

You can also use AutomaticPopulator which allows you to create fake data for one table based on its structure or column names.

Create file e.g. `bin/command.php` as shown below (or add PopulatorCommand to existing Symfony console application):

```
// file bin/command.php

$application = new Symfony\Component\Console\Application();
$populator = new Populator\Command\PopulatorCommand();
$populator->addDatabase(new Populator\Database\Database('db_name', 'mysql:dbname=db_name;host=db_host', 'db_user', 'db_password'));

$table1Populator = new Populator\Populator\AutomaticPopulator('table_1', 50);
$populator->addPopulator($table1Populator);

$application->add($populator);
$application->run();
```

This setup will populate 50 fake rows for database table with name `table_1` after executing this command:

```
php bin/command.php populator:populate

```

###  Health Score

43

—

FairBetter than 91% of packages

Maintenance37

Infrequent updates — may be unmaintained

Popularity35

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity72

Established project with proven stability

 Bus Factor1

Top contributor holds 96.7% 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 ~622 days

Total

5

Last Release

573d ago

Major Versions

0.1.0 → 1.0.02019-04-01

PHP version history (3 changes)0.1.0PHP &gt;=7.1.0

1.2.0PHP &gt;=7.4 &lt;8.3

1.3.0PHP ^7.4 || ^8.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/9377319?v=4)[Michal Lulco](/maintainers/lulco)[@lulco](https://github.com/lulco)

---

Top Contributors

[![lulco](https://avatars.githubusercontent.com/u/9377319?v=4)](https://github.com/lulco "lulco (58 commits)")[![riki137](https://avatars.githubusercontent.com/u/1223388?v=4)](https://github.com/riki137 "riki137 (1 commits)")[![tonop01](https://avatars.githubusercontent.com/u/29866948?v=4)](https://github.com/tonop01 "tonop01 (1 commits)")

---

Tags

phpdatabaseFake data

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/lulco-populator/health.svg)

```
[![Health](https://phpackages.com/badges/lulco-populator/health.svg)](https://phpackages.com/packages/lulco-populator)
```

###  Alternatives

[lulco/phoenix

Database Migrations for PHP

180329.4k4](/packages/lulco-phoenix)[webnet-fr/database-anonymizer

Database anonymizer.

3733.8k3](/packages/webnet-fr-database-anonymizer)[wayofdev/laravel-cycle-orm-adapter

🔥 A Laravel adapter for CycleORM, providing seamless integration of the Cycle DataMapper ORM for advanced database handling and object mapping in PHP applications.

3516.7k3](/packages/wayofdev-laravel-cycle-orm-adapter)[modul-is/orm

Lightweight hybrid ORM/Explorer

1118.1k](/packages/modul-is-orm)

PHPackages © 2026

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