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

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

alexeyyashin/model-faker
========================

seed-faker based model filler

v1.0.1(11mo ago)013MITPHPPHP &gt;=8.0

Since May 17Pushed 11mo ago1 watchersCompare

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

READMEChangelog (2)Dependencies (1)Versions (3)Used By (0)

model-faker
===========

[](#model-faker)

A flexible and extensible PHP library for automatically populating object models with dummy data, built on top of seed-faker.

Requirements
------------

[](#requirements)

- PHP 8.0 or higher
- Composer

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

[](#installation)

```
composer require alexeyyashin/model-faker
```

Usage
-----

[](#usage)

See the `examples/demo.php` file for a complete demonstration:

```
use AlexeyYashin\ModelFaker\ModelFaker;
use DemoModel;

$faker = new ModelFaker();

// Configure rules (optional)
$faker
    ->rulePropertyName('name', fn() => 'John Doe')
    ->ruleMethodName('setCreatedAt', fn() => new \DateTime())
    ->ruleAcceptType(\DateTime::class, fn() => new \DateTime());

$model = new DemoModel();
$faker->fillAll($model);

var_dump($model);
```

API Reference
-------------

[](#api-reference)

- `ruleAcceptType(string $type, callable $rule): static` — Register a generator for parameter types.
- `ruleMethodName(string $method, callable $rule): static` — Register a generator for specific setter methods.
- `rulePropertyName(string $property, callable $rule): static` — Register a generator for specific properties.
- `fillExplicitly(object $model, bool $existing = true): int` — Fill explicitly named fields and setters.
- `fillSetters(object $model): int` — Fill all public setters based on parameter types.
- `fillProperties(object $model): int` — Fill all public properties based on type declarations.
- `fillAll(object $model): int` — Fill both public properties and methods based on type declarations and parameter types.

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance50

Moderate activity, may be stable

Popularity5

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity43

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 ~2 days

Total

2

Last Release

358d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/10206f77ccff237e4f6173d09004c86e5c8276845c023dde6b5c34797f79d203?d=identicon)[alexeyyashin](/maintainers/alexeyyashin)

---

Top Contributors

[![alexeyyashin](https://avatars.githubusercontent.com/u/47781271?v=4)](https://github.com/alexeyyashin "alexeyyashin (3 commits)")

### Embed Badge

![Health badge](/badges/alexeyyashin-model-faker/health.svg)

```
[![Health](https://phpackages.com/badges/alexeyyashin-model-faker/health.svg)](https://phpackages.com/packages/alexeyyashin-model-faker)
```

###  Alternatives

[hazaveh/verify-domain

Verify Domain Ownership with PHP

238.6k1](/packages/hazaveh-verify-domain)

PHPackages © 2026

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