Download the PHP package phdevutils/faker without Composer
On this page you can find all versions of the php package phdevutils/faker. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download phdevutils/faker
More information about phdevutils/faker
Files in phdevutils/faker
Package faker
Short Description 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).
License MIT
Informations about the package faker
phdevutils/faker
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 (the validators).
Install
Requires PHP 8.2+ (uses \Random\Engine\Mt19937 for per-instance PRNG isolation).
Quick start
API Reference
Faker class
new Faker(int $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.
$f->seed(int $value): void
Resets the PRNG to start a fresh sequence from $value.
$f->name β Filipino names
$f->name->first(?string $gender = null): string
Returns a Filipino given name. If $gender is null, picks 'male' / 'female' randomly (50/50).
$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->full(?string $gender = null): string
Returns "{$first} {$last}".
$f->name->fullWithMiddle(?string $gender = null): string
Returns "{$first} {$motherMaiden} {$last}" β Filipino convention where the middle name is the mother's maiden surname.
$f->address β PSGC-backed addresses
$f->address->region(): array
Returns one of the 17 PH regions as an associative array: ['code' => string, 'name' => string, 'designation' => string].
$f->address->province(): array
Returns one of ~80 PH provinces: ['code' => string, 'name' => string, 'region' => string]. region is the parent region code.
$f->address->street(): string
Returns a single-line street like "{number} {name} {type}". Names drawn from heroes / flowers / trees pools.
$f->address->full(): string
Composed full address: "{street}, {province}, {region}".
$f->phone β PH mobile and landline
$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->mobileByNetwork(string $network): string
Returns a mobile number with a prefix belonging to the given network. $network must be one of 'Globe', 'Smart', 'Sun', 'DITO'.
Throws \InvalidArgumentException for unknown networks.
$f->phone->landline(): string
Returns a PH landline with a real area code. Metro Manila numbers use 8-digit subscribers, others 7-digit.
$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
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->sss(): string
Returns a 10-digit SSS number formatted XX-XXXXXXX-X.
$f->id->philhealth(): string
Returns a 12-digit PhilHealth ID formatted XX-XXXXXXXXX-X.
$f->id->pagibig(): string
Returns a 12-digit Pag-IBIG MID formatted XXXX-XXXX-XXXX.
$f->id->nationalID(): string
Returns a 16-digit PhilSys National ID (PhilSys Card Number) formatted XXXX-XXXX-XXXX-XXXX.
$f->id->umid(): string
Returns a 12-digit UMID Common Reference Number formatted XXXX-XXXXXXX-X.
$f->id->passport(): string
Returns a Philippine ePassport number: a letter, 7 digits, then a letter.
$f->id->prc(): string
Returns a 7-digit PRC professional license / registration number.
$f->money β peso amounts
$f->money->peso(int $min = 0, int $max = 10000): float
Returns a random peso amount with centavos.
$f->money->salary(): float
Returns a realistic PH monthly salary (PHP 15,000 β 80,000).
$f->money->price(): float
Returns a sari-sariβscale price (PHP 5 β 500).
$f->business β PH-flavored business names
$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
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
- Government IDs are format-valid only (see warning in
$f->idsection 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
MIT