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.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package faker

phdevutils/faker

Packagist version License: MIT Made in PH

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:


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

License

MIT


All versions of faker with dependencies

PHP Build Version
Package Version
Requires php Version >=8.2
phdevutils/core Version ^0.2.0
phdevutils/payroll Version ^0.3.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package phdevutils/faker contains the following files

Loading the files please wait ...