PHPackages                             miksir/yii2-db-faker - 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. miksir/yii2-db-faker

ActiveYii2-extension[Database &amp; ORM](/categories/database)

miksir/yii2-db-faker
====================

Fill your database table with fake data

1.0.1(10y ago)2879[1 issues](https://github.com/miksir/yii2-db-faker/issues)MITPHP

Since May 2Pushed 10y ago1 watchersCompare

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

READMEChangelogDependencies (2)Versions (2)Used By (0)

This Yii2 command can fill your database with fake data. Useful if you need lot of fake data, 1 mil rows and more.

You can switch between different data generators (or write your own) and different database connectors.

Props:

- you can write own sources of fake data (proxy to fzaninotto/Faker included)
- different connectors to datbase for save data. ActiveRecord - slow but with model logic, YiiDAO - fast batch insert, TODO: postgresql COPY connector.

Generators included:

- FakeGenerator: this is proxy to [`Faker`](https://github.com/fzaninotto/Faker)and use same logic, paths and templates as [`yii2-faker`](https://github.com/yiisoft/yii2-faker) . Read yii2-faker documentation about creating fixtures template file

Database connectors (called here as dbproviders):

- Csv: simple csv writer
- ActiveRecord: create model, fill with data and call -&gt;save()
- YiiDAO: insert data using sql (via Yii's PDO), can insert multiple rows per one insert

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

[](#installation)

Use composer :)

```
composer require miksir/yii2-db-faker

```

You should configure your application as follows (usually in console.php; and you can use any alias, not only "faker"):

```
'controllerMap' => [
 'faker' => [
     'class' => 'MiksIr\Yii2DbFaker\FakerController',
 ],
],
```

Call help for current generator and dbprovider

```
yii faker/help

```

Examples
--------

[](#examples)

```
yii faker/generate --count=1000000 --dbprovider=YiiDAO generator_template=users dbprovider_table=users dbprovider_truncate=1

```

Truncate table users and create about 1 million rows using template from @tests/unit/templates/fixtures/users.php

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance10

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity63

Established project with proven stability

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

Unknown

Total

1

Last Release

3663d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/21e33add6540cc00c56609e7a0853f8ce65f42b373912fa796573c5e133a3e60?d=identicon)[MiksIr](/maintainers/MiksIr)

### Embed Badge

![Health badge](/badges/miksir-yii2-db-faker/health.svg)

```
[![Health](https://phpackages.com/badges/miksir-yii2-db-faker/health.svg)](https://phpackages.com/packages/miksir-yii2-db-faker)
```

###  Alternatives

[yii2tech/illuminate

Yii2 to Laravel Migration Package

11315.1k](/packages/yii2tech-illuminate)[mootensai/yii2-relation-trait

Yii 2 Models load with relation, &amp; transaction save with relation

47220.3k9](/packages/mootensai-yii2-relation-trait)[nhkey/yii2-activerecord-history

Storage history of changes to ActiveRecord

46143.4k1](/packages/nhkey-yii2-activerecord-history)[dmstr/yii2-db

Database extensions

19618.8k6](/packages/dmstr-yii2-db)[spanjeta/yii2-backup

Database Backup and Restore functionality

285.0k1](/packages/spanjeta-yii2-backup)

PHPackages © 2026

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