PHPackages                             phdevutils/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. [Testing &amp; Quality](/categories/testing)
4. /
5. phdevutils/faker

ActiveLibrary[Testing &amp; Quality](/categories/testing)

phdevutils/faker
================

Filipino-localized fake-data generator — names, addresses (regions/provinces/cities), phones, government IDs, peso amounts, businesses, PH holiday/working-day dates, and full payslip fixtures (uses phdevutils/payroll).

v0.3.0(1w ago)012↓50%MITPHPPHP &gt;=8.2

Since May 19Pushed 1w agoCompare

[ Source](https://github.com/kon2raya24/ph-faker-php)[ Packagist](https://packagist.org/packages/phdevutils/faker)[ RSS](/packages/phdevutils-faker/feed)WikiDiscussions main Synced 1w ago

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

phdevutils/faker
================

[](#phdevutilsfaker)

[![Packagist version](https://camo.githubusercontent.com/96c6dbfc0c6e7f1a1b92752e28c1397378fd7588e5c3b91d7511fba5cb66d289/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f70686465767574696c732f66616b65723f6c6162656c3d5061636b616769737426636f6c6f723d663238643161266c6f676f3d7061636b6167697374266c6f676f436f6c6f723d7768697465)](https://packagist.org/packages/phdevutils/faker)[![License: MIT](https://camo.githubusercontent.com/7013272bd27ece47364536a221edb554cd69683b68a46fc0ee96881174c4214c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e737667)](https://github.com/kon2raya24/ph-faker/blob/main/LICENSE)[![Made in PH](https://camo.githubusercontent.com/e9d62429053ae0e0e8db5071df8eaba9a45ad7f91130696a66262598b44094e5/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6d616465253230696e2d2546302539462538372542352546302539462538372541442532305068696c697070696e65732d303033384138)](https://github.com/kon2raya24)

Filipino-localized fake-data generator for PHP — Filipino names, addresses (PSGC regions + provinces), phone numbers with network detection, format-valid government IDs, peso amounts, and PH-flavored business names. Driven by a seeded deterministic PRNG so your test fixtures are reproducible.

Sibling of [`phdevutils/core`](https://packagist.org/packages/phdevutils/core) (the validators).

Install
-------

[](#install)

```
composer require --dev phdevutils/faker
```

Requires PHP 8.2+ (uses `\Random\Engine\Mt19937` for per-instance PRNG isolation).

Quick start
-----------

[](#quick-start)

```
use PhDevUtils\Faker\Faker;

$f = new Faker(seed: 42);

$f->name->full();              // 'Maria Santos'
$f->address->full();           // '123 Rizal St., Cavite, CALABARZON'
$f->phone->mobile();           // '+639171234567'
$f->id->tin();                 // '123-456-789-000'
$f->business->name();          // 'Aling Nena Sari-Sari Store'
```

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

[](#api-reference)

### `Faker` class

[](#faker-class)

#### `new Faker(int $seed = 0x0DEFEED)`

[](#new-fakerint-seed--0x0defeed)

Creates a new Faker instance with optional integer seed. Each instance owns its own `\Random\Randomizer` engine — two instances with different seeds never interfere.

```
$f1 = new Faker();         // default seed
$f2 = new Faker(seed: 42); // custom seed → reproducible
```

#### `$f->seed(int $value): void`

[](#f-seedint-value-void)

Resets the PRNG to start a fresh sequence from `$value`.

```
$f = new Faker(1);
$f->name->full();   // 'Cristina Cruz'
$f->seed(1);
$f->name->full();   // 'Cristina Cruz' (same — sequence reset)
```

---

### `$f->name` — Filipino names

[](#f-name--filipino-names)

#### `$f->name->first(?string $gender = null): string`

[](#f-name-firststring-gender--null-string)

Returns a Filipino given name. If `$gender` is `null`, picks `'male'` / `'female'` randomly (50/50).

```
$f->name->first();           // 'Maria'
$f->name->first('male');     // 'Juan'
$f->name->first('female');   // 'Liza'
```

#### `$f->name->last(): string`

[](#f-name-last-string)

Returns a Filipino surname (Spanish-origin, native, or Chinese-Filipino patterns). Politically-loaded surnames (heads of state, major political dynasties) are deliberately excluded.

```
$f->name->last();   // 'Reyes'
```

#### `$f->name->full(?string $gender = null): string`

[](#f-name-fullstring-gender--null-string)

Returns `"{$first} {$last}"`.

```
$f->name->full();           // 'Maria Santos'
$f->name->full('male');     // 'Carlos Mendoza'
```

#### `$f->name->fullWithMiddle(?string $gender = null): string`

[](#f-name-fullwithmiddlestring-gender--null-string)

Returns `"{$first} {$motherMaiden} {$last}"` — Filipino convention where the middle name is the mother's maiden surname.

```
$f->name->fullWithMiddle();   // 'Maria Reyes Santos'
```

---

### `$f->address` — PSGC-backed addresses

[](#f-address--psgc-backed-addresses)

#### `$f->address->region(): array`

[](#f-address-region-array)

Returns one of the 17 PH regions as an associative array: `['code' => string, 'name' => string, 'designation' => string]`.

```
$f->address->region();
// ['code' => '04', 'name' => 'CALABARZON', 'designation' => 'Region IV-A']
```

#### `$f->address->province(): array`

[](#f-address-province-array)

Returns one of ~80 PH provinces: `['code' => string, 'name' => string, 'region' => string]`. `region` is the parent region code.

```
$f->address->province();
// ['code' => '0434', 'name' => 'Cavite', 'region' => '04']
```

#### `$f->address->street(): string`

[](#f-address-street-string)

Returns a single-line street like `"{number} {name} {type}"`. Names drawn from heroes / flowers / trees pools.

```
$f->address->street();   // '8090 Burgos Avenue'
```

#### `$f->address->full(): string`

[](#f-address-full-string)

Composed full address: `"{street}, {province}, {region}"`.

```
$f->address->full();
// '8090 Burgos Avenue, La Union, Ilocos Region'
```

---

### `$f->phone` — PH mobile and landline

[](#f-phone--ph-mobile-and-landline)

#### `$f->phone->mobile(): string`

[](#f-phone-mobile-string)

Returns a random PH mobile number in E.164 format. Network chosen randomly across Globe / Smart / Sun / DITO. The prefix is real — feeding it back into `phdevutils/core`'s `Phone::parseMobile` returns the same network.

```
$f->phone->mobile();   // '+639171234567'
```

#### `$f->phone->mobileByNetwork(string $network): string`

[](#f-phone-mobilebynetworkstring-network-string)

Returns a mobile number with a prefix belonging to the given network. `$network` must be one of `'Globe'`, `'Smart'`, `'Sun'`, `'DITO'`.

```
$f->phone->mobileByNetwork('Globe');   // '+639170123456'
$f->phone->mobileByNetwork('DITO');    // '+639950987654'
```

Throws `\InvalidArgumentException` for unknown networks.

#### `$f->phone->landline(): string`

[](#f-phone-landline-string)

Returns a PH landline with a real area code. Metro Manila numbers use 8-digit subscribers, others 7-digit.

```
$f->phone->landline();   // '(02) 8123-4567'
$f->phone->landline();   // '(32) 234-5678'
```

---

### `$f->id` — government IDs (format-valid only)

[](#f-id--government-ids-format-valid-only)

> ⚠️ All generated IDs are **format-valid only**. They follow the right digit count and shape but may collide with real persons' IDs by chance. **Use for tests only.** Never submit faker output to BIR, SSS, PhilHealth, Pag-IBIG, or any production system.

#### `$f->id->tin(bool $withBranch = true): string`

[](#f-id-tinbool-withbranch--true-string)

Returns a BIR TIN. With `$withBranch: true` (default) returns 12 digits `XXX-XXX-XXX-XXX`; with `false` returns 9 digits `XXX-XXX-XXX`.

```
$f->id->tin();        // '123-456-789-000'
$f->id->tin(true);    // '123-456-789-456' (with branch)
$f->id->tin(false);   // '123-456-789'     (individual, no branch)
```

#### `$f->id->sss(): string`

[](#f-id-sss-string)

Returns a 10-digit SSS number formatted `XX-XXXXXXX-X`.

```
$f->id->sss();   // '12-3456789-0'
```

#### `$f->id->philhealth(): string`

[](#f-id-philhealth-string)

Returns a 12-digit PhilHealth ID formatted `XX-XXXXXXXXX-X`.

```
$f->id->philhealth();   // '12-345678901-2'
```

#### `$f->id->pagibig(): string`

[](#f-id-pagibig-string)

Returns a 12-digit Pag-IBIG MID formatted `XXXX-XXXX-XXXX`.

```
$f->id->pagibig();   // '1234-5678-9012'
```

#### `$f->id->nationalID(): string`

[](#f-id-nationalid-string)

Returns a 16-digit PhilSys National ID (PhilSys Card Number) formatted `XXXX-XXXX-XXXX-XXXX`.

```
$f->id->nationalID();   // '1234-5678-9012-3456'
```

#### `$f->id->umid(): string`

[](#f-id-umid-string)

Returns a 12-digit UMID Common Reference Number formatted `XXXX-XXXXXXX-X`.

```
$f->id->umid();   // '1234-5678901-2'
```

#### `$f->id->passport(): string`

[](#f-id-passport-string)

Returns a Philippine ePassport number: a letter, 7 digits, then a letter.

```
$f->id->passport();   // 'P1234567A'
```

#### `$f->id->prc(): string`

[](#f-id-prc-string)

Returns a 7-digit PRC professional license / registration number.

```
$f->id->prc();   // '1234567'
```

---

### `$f->money` — peso amounts

[](#f-money--peso-amounts)

#### `$f->money->peso(int $min = 0, int $max = 10000): float`

[](#f-money-pesoint-min--0-int-max--10000-float)

Returns a random peso amount with centavos.

```
$f->money->peso();              // 4218.73
$f->money->peso(100, 500);      // 387.21
```

#### `$f->money->salary(): float`

[](#f-money-salary-float)

Returns a realistic PH monthly salary (PHP 15,000 – 80,000).

```
$f->money->salary();   // 42158.50
```

#### `$f->money->price(): float`

[](#f-money-price-float)

Returns a sari-sari–scale price (PHP 5 – 500).

```
$f->money->price();   // 87.25
```

---

### `$f->business` — PH-flavored business names

[](#f-business--ph-flavored-business-names)

#### `$f->business->name(): string`

[](#f-business-name-string)

Returns a fake business name. Composes from three patterns picked randomly:

- `"{honorific} {given name} {suffix}"` — e.g. `Aling Nena Sari-Sari Store`, `Mang Pedro Carinderia`
- `"{initials} {suffix}"` — e.g. `RJ Trading`, `MNL Foods`
- `"{phrase} {suffix or last name}"` — e.g. `Doon Sa Kanto Cafe`, `Tindahan ni Reyes`

```
$f->business->name();   // 'Aling Nena Sari-Sari Store'
$f->business->name();   // 'RJ Enterprises'
$f->business->name();   // 'Tindahan ni Reyes'
```

---

Determinism
-----------

[](#determinism)

`new Faker($seed)` and `$f->seed($n)` make subsequent calls deterministic *within the same PHP runtime*. Same seed → same sequence.

Cross-language seed compatibility with the JS package is **not** guaranteed — JS uses mulberry32, PHP uses `\Random\Engine\Mt19937`.

Each `Faker` instance owns its own engine, so multiple instances with different seeds run independently — the package does not touch `mt_srand` global state.

⚠️ Important warnings
---------------------

[](#️-important-warnings)

- **Government IDs** are format-valid only (see warning in `$f->id` section above).
- **Phone numbers** use real network prefixes but random subscriber digits. May collide with real numbers. Use for tests only.
- **Names** are curated from public sources. Celebrity names and political-dynasty surnames are deliberately excluded.

License
-------

[](#license)

MIT

###  Health Score

40

—

FairBetter than 86% of packages

Maintenance98

Actively maintained with recent releases

Popularity8

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity40

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

5

Last Release

12d ago

### Community

Maintainers

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

---

Top Contributors

[![kon2raya24](https://avatars.githubusercontent.com/u/167972097?v=4)](https://github.com/kon2raya24 "kon2raya24 (8 commits)")

---

Tags

fakerfilipinopackagistphilippinesphpfakermockholidaysphilippinesFake datatest-fixturespsgcpayslipfilipino

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[mockery/mockery

Mockery is a simple yet flexible PHP mock object framework

10.7k516.1M26.0k](/packages/mockery-mockery)[phpspec/prophecy

Highly opinionated mocking framework for PHP 5.3+

8.5k557.4M750](/packages/phpspec-prophecy)[nelmio/alice

Expressive fixtures generator

2.6k44.6M152](/packages/nelmio-alice)[zenstruck/foundry

A model factory library for creating expressive, auto-completable, on-demand dev/test fixtures with Symfony and Doctrine.

78813.1M131](/packages/zenstruck-foundry)[php-mock/php-mock

PHP-Mock can mock built-in PHP functions (e.g. time()). PHP-Mock relies on PHP's namespace fallback policy. No further extension is needed.

36919.3M118](/packages/php-mock-php-mock)[brain/monkey

Mocking utility for PHP functions and WordPress plugin API

33913.7M436](/packages/brain-monkey)

PHPackages © 2026

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