Get Started
Fauxify is a PHP library designed for developers to generate synthetic data efficiently. It simplifies the creation of realistic fake data for database testing and development, offering a user-friendly alternative similar to FakerPHP. With a range of predefined data providers and customization options.
Installation
composer require fauxify/fauxify
Basic Usage
After installing the library, you can start using it by creating a new instance of the Fauxify class. The following example demonstrates how to generate a random name using the library.
If haven't include vendor autoload in entry point/page.
require_once 'vendor/autoload.php';
Then,
use Fauxify\Fauxify\Fauxify;
$fauxify = Fauxify::create();
echo $faux->name();
Locale
Fauxify has the objective of generating two types of fake data and supports only two locales: "Nep" and "Eng," with "Eng" being the default.
Eng / Default
$fauxify = Fauxify::create();
// Or
$fauxify = Fauxify::create("Eng");
Nep
$fauxify = Fauxify::create("Nep");
Provider
Unique
$fauxify->city('unique');
// Or
for($i = 0; $i < 10; $i++) {
echo $fauxify->city('unique');
}
It has a range of predefined data providers, each with its own unique set of methods. The following table provides an overview of the available providers and their respective methods.
Porvider | Params | Unique | Max |
---|---|---|---|
->name() | No | No | --- |
->maleName() | No | No | --- |
->femaleName() | No | No | --- |
->city() | ['unique'] OR [NULL] | Yes | 33 |
->payment() | ['unique'] OR [NULL] | Yes | 5 |
->mobileNumber() | No | No | --- |
->blogTitle() | [Size of Words] OR [NULL] | No | --- |
->blogContent() | [Size of Words] OR [NULL] | No | --- |
->bank() | ['unique'] OR [NULL] | Yes | 54 |
->classABank() | ['unique'] OR [NULL] | Yes | 20 |
->classBBank() | ['unique'] OR [NULL] | Yes | 17 |
->classCBank() | ['unique'] OR [NULL] | Yes | 17 |