PHPackages                             germanow/yii2-active-record-seeder - 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. germanow/yii2-active-record-seeder

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

germanow/yii2-active-record-seeder
==================================

Seeds database with test or default values.

0.0.7(6y ago)3877[1 issues](https://github.com/germanow/yii2-active-record-seeder/issues)MITPHP

Since Jan 17Pushed 5y ago1 watchersCompare

[ Source](https://github.com/germanow/yii2-active-record-seeder)[ Packagist](https://packagist.org/packages/germanow/yii2-active-record-seeder)[ Docs](https://github.com/germanow/yii2-active-record-seeder)[ RSS](/packages/germanow-yii2-active-record-seeder/feed)WikiDiscussions master Synced 1w ago

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

Yii2 Active Record Seeder
=========================

[](#yii2-active-record-seeder)

Seeds database with test or default values.

Features
========

[](#features)

- Seeds tables with different strategy using filler classes
- Support relations

Installation
============

[](#installation)

Run command:

```
$ composer require germanow/yii2-active-record-seeder

```

Usage
=====

[](#usage)

Create ActiveRecordSeeder, configure fillers, call `fill` method:

```
use germanow\yii2ActiveRecordSeeder\ActiveRecordSeeder;
use germanow\yii2ActiveRecordSeeder\AddFiller;
use germanow\yii2ActiveRecordSeeder\OverwriteFiller;

$seeder = new ActiveRecordSeeder([
    'fillers' => [
        // Default filler is EmptyFiller, which fill table if it's empty
        [
            // Specify name of ActiveRecord model class
            'recordClass' => EventType::class,
            'data' => [
                [
                    'id' => 1,
                    'name' => 'Birthday',
                ],
            ],
        ],
        // OverwriteFiller delete all records before filling
        [
            'class' => OverwriteFiller::class,
            'recordClass' => EventType::class,
            'data' => [
                [
                    'id' => 1,
                    'canonicalName' => 'Birthday',
                    'class' => 'lulz',
                    // Fill relations
                    'translations' => [
                        [
                            'name' => 'День рождения',
                            'languageId' => '5',
                        ],
                    ],
                ],
            ],
        ],
        // AddFiller add records if they not exists in table with such id or attributes.
        [
            'class' => AddFiller::class,
            'recordClass' => EventType::class,
            'data' => [
                // check exists by id
                [
                    'id' => 1,
                    'name' => 'Birthday',
                ],
                // check exists by canonicalName
                [
                    'name' => 'Meeting',
                ],
            ],
        ],
    ],
]);
$seeder->fill();
```

Why
===

[](#why)

I wrote this package for filling system tables, which must always be filled, such as `EventType`, `EventStatus` and other. Existing solutions, such as [yii2-db-seeder](https://github.com/tebazil/yii2-db-seeder), don't support filling strategy.

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance13

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~0 days

Total

7

Last Release

2310d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/8e1c910a80e3306025c9eb7e37ec71d6357ee0edcefd0e37ffd1aab6f7cf9f14?d=identicon)[germanow](/maintainers/germanow)

---

Top Contributors

[![germanow](https://avatars.githubusercontent.com/u/5995709?v=4)](https://github.com/germanow "germanow (12 commits)")

---

Tags

dbyii2active-recordseeding

### Embed Badge

![Health badge](/badges/germanow-yii2-active-record-seeder/health.svg)

```
[![Health](https://phpackages.com/badges/germanow-yii2-active-record-seeder/health.svg)](https://phpackages.com/packages/germanow-yii2-active-record-seeder)
```

###  Alternatives

[voskobovich/yii2-linker-behavior

This behavior makes it easy to maintain many-to-many and one-to-many relations in your ActiveRecord models.

80319.0k9](/packages/voskobovich-yii2-linker-behavior)[dmstr/yii2-db

Database extensions

19618.8k6](/packages/dmstr-yii2-db)[sjaakp/yii2-spatial

Yii2 ActiveRecord supporting MySQL spatial data

1873.8k1](/packages/sjaakp-yii2-spatial)[mg-code/yii2-helpers

A collection of useful helper classes for Yii framework 2.0

2022.5k5](/packages/mg-code-yii2-helpers)[edgardmessias/yii2-firebird

Firebird connector for Yii2 framework

2415.5k](/packages/edgardmessias-yii2-firebird)[arogachev/yii2-tree

Database tree structures management for Yii 2 framework

222.1k](/packages/arogachev-yii2-tree)

PHPackages © 2026

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