Skip to content
/ faker Public

Random (fake) data generator for PHP

License

Notifications You must be signed in to change notification settings

schalkt/faker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

48 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Random data generator for PHP

Latest Stable Version Total Downloads PHP Version License GitHub issues Build GitHub stars

  • randomly generated characters, words, sentences
  • customizeble vowels and consonants
    • fake Esperanto (Evevete etet sek edeleme)
    • pattern look (DIBI.BOB.BO.DID.IBI.IBID.BID)
  • word suffix for funny names (mikozy nadusy hetezy jukesy)

Install

  • composer require schalkt/faker

Examples

    require_once '/vendor/autoload.php';

    use Schalkt\Faker\Faker;

    $faker = Faker::init();

    $faker->fullname(5, 10); // Sutida Ohisovis
    $faker->firstname(7, 7, Faker::FIRST_VOWEL); // Emubefy
    $faker->lastname(5, 7); // Zusey
    $faker->email(); // punuw.honiw@ajesug.gax
    $faker->password(4, 4, 3, '.'); // W2gg.lsgq.FET0
    $faker->word(5); // focix
    $faker->words(5, ', '); // rabija, yigav, bacera, cunay, okzupu
    $faker->words(2, ' | ', 4, 4, Faker::FIRST_CONSONANT, ['zy', 'sy']); // dodosy | rivozy
    $faker->sentence(5); // Uxibawoz witowarehep effemerogola buinaxepugo nuxehow.
    $faker->text(3, 3, 3); // Icolivotuse rebotuk sulageye. Xaco najud quq.
    $faker->int(1, 1000); // 238
    $faker->float(100, 200, 4); // 175.3874
    $faker->boolean(); // true or false    
    $faker->repeat('.', 4, 4, 3, 'oOo'); // ....oOo....oOo....    
    $faker->repeat('#', 3, 3, 4, '-'); // ###-###-###-###
    $faker->repeat('124', 1, 5, 4, ' + '); // 2144 + 24444 + 444 + 22141
    $faker->mask('###-###-###-###', 'ABCDEFG'); // AAE-BAF-DDB-AAF
    $faker->mask('##-##-##-##', '01'); // 11-10-01-10
    $faker->pick(['CEO', 'CTO', 'Founder', 'Director'], 3, ', '); // Director, CEO, CTO
    $faker->date(); // 2001-07-21
    $faker->date('2024-01-01', '2024-12-31', 'Y.m.'); // 2024.02.
    $faker->hash('sha256'); // random hash
    $faker->token(32); // api token
    $faker->url(); // https://example.com/random
    $faker->domain(); // example.com
    $faker->city(); // Random City
    $faker->zipcode(4); // 1234
    $faker->country(); // Random Country
    $faker->streetName(); // Random Street Name
    $faker->street(); // Random Street Name 123
    $faker->address(); // Random Street Name 123, 1234 Random City, Random Country

Fake esperente

    require_once '/vendor/autoload.php';

    use Schalkt\Faker\Faker;

    $faker = Faker::init([
      'vowels' => 'e',
      'consonants' => 'bhdlmnkpstvz',
      'nextChar' => [
        'sameChar' => 0, // percent between 0-100
        'sameType' => 0, // percent between 0-100
        'double' => 0 // percent between 0-100
      ],
    ]);

    $faker->text(20, 3, 10); // Sedev emeze evekem ez denebebekepep...

About

Random (fake) data generator for PHP

Topics

Resources

License

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Languages