• This repository has been archived on 05/Jul/2023
  • Stars
    star
    187
  • Rank 206,464 (Top 5 %)
  • Language
    PHP
  • License
    MIT License
  • Created over 13 years ago
  • Updated over 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

The easiest way to generate fake data in PHP.

Faker

Faker is a PHP port of a Ruby port of Data::Faker from Perl.

It's a convoluted path, but you're the beneficiary of a simple way to generate fake data for your PHP 5.3 project.

INSTALLATION

$ composer require bobthecow/faker:dev-master

Usage is fairly straightforward:

echo \Faker\Name::name();    // "Leeroy Jenkins"

There are a few more to choose from:

\Faker\Address::address();
\Faker\Address::streetName();
\Faker\Address::streetAddress($includeSecondary = false);
\Faker\Address::city();
\Faker\Address::state();
\Faker\Address::stateAbbr();
\Faker\Address::zipCode();
\Faker\Address::zip();
\Faker\Address::postcode();
\Faker\Address::cityStateZip();
\Faker\Address::country();


\Faker\Company::name();
\Faker\Company::suffix();
\Faker\Company::catchPhrase();
\Faker\Company::bs();


\Faker\DateTime::timestamp();
\Faker\DateTime::date($format = null);
\Faker\DateTime::dateFormat();
\Faker\DateTime::time($format = null);
\Faker\DateTime::timeFormat();
\Faker\DateTime::dateTime($format = null);
\Faker\DateTime::dateTimeFormat();
\Faker\DateTime::month();
\Faker\DateTime::monthAbbr();
\Faker\DateTime::weekday();
\Faker\DateTime::weekdayAbbr();


\Faker\Geo::point();
\Faker\Geo::latitude();
\Faker\Geo::longitude();
\Faker\Geo::pointDMS();
\Faker\Geo::latitudeDMS();
\Faker\Geo::longitudeDMS();

\Faker\Geo\BuenosAires::point();
\Faker\Geo\Chicago::latitude();
\Faker\Geo\Jakarta::longitude();
\Faker\Geo\London::pointDMS();
\Faker\Geo\LosAngeles::latitudeDMS();
\Faker\Geo\MexicoCity::longitudeDMS();

\Faker\Geo::point(\Faker\Geo\NewDelhi::bounds());
\Faker\Geo::latitude(\Faker\Geo\NewYork::bounds());
\Faker\Geo::longitude(\Faker\Geo\Paris::bounds());
\Faker\Geo::pointDMS(\Faker\Geo\Portland::bounds());
\Faker\Geo::latitudeDMS(\Faker\Geo\SanFrancisco::bounds());
\Faker\Geo::longitudeDMS(\Faker\Geo\SaoPaulo::bounds());

\Faker\Geo::point([[$swLat, $swLng], [$neLat, $neLng]]);
\Faker\Geo::latitude([$latMin, $latMax]);
\Faker\Geo::longitude([$lngMin, $lngMax]);
\Faker\Geo::pointDMS([[$swLat, $swLng], [$neLat, $neLng]]);
\Faker\Geo::latitudeDMS([$latMin, $latMax]);
\Faker\Geo::longitudeDMS([$lngMin, $lngMax]);

\Faker\Geo\BuenosAires::point();
\Faker\Geo\Chicago::point();
\Faker\Geo\Jakarta::point();
\Faker\Geo\London::point();
\Faker\Geo\LosAngeles::point();
\Faker\Geo\MexicoCity::point();
\Faker\Geo\NewDelhi::point();
\Faker\Geo\NewYork::point();
\Faker\Geo\Paris::point();
\Faker\Geo\Portland::point();
\Faker\Geo\SanFrancisco::point();
\Faker\Geo\SaoPaulo::point();
\Faker\Geo\Seoul::point();
\Faker\Geo\Tokyo::point();
\Faker\Geo\UnitedStates::point();


\Faker\Internet::email($name = null);
\Faker\Internet::freeEmail($name = null);
\Faker\Internet::safeEmail($name = null);
\Faker\Internet::userName($name = null);
\Faker\Internet::domainName();
\Faker\Internet::safeDomainName();
\Faker\Internet::domainWord();
\Faker\Internet::domainSuffix();
\Faker\Internet::ipv4Address();
\Faker\Internet::slug($str = null, $glue = array('.', '-', '_'));


\Faker\Lorem::word();
\Faker\Lorem::words($num = 3);
\Faker\Lorem::sentence($wordCount = 4);
\Faker\Lorem::sentences($sentenceCount = 3);
\Faker\Lorem::paragraph($sentenceCount = 3);
\Faker\Lorem::paragraphs($paragraphCount = 3);


\Faker\Name::name();
\Faker\Name::firstName();
\Faker\Name::lastName();
\Faker\Name::prefix();
\Faker\Name::suffix();


\Faker\PhoneNumber::phoneNumber();
\Faker\PhoneNumber::safePhoneNumber();

Yeah,

... it's an entire library made up of static methods. Just to bug Bulat :)

More Repositories

1

psysh

A REPL for PHP
PHP
9,637
star
2

mustache.php

A Mustache implementation in PHP.
PHP
3,202
star
3

git-flow-completion

Bash, Zsh and fish completion support for git-flow.
Shell
2,783
star
4

genghis

The single-file MongoDB admin app
Ruby
1,452
star
5

Ruler

A simple stateless production rules engine for modern PHP
PHP
1,025
star
6

solarized-seestyle

A precision color scheme for Coda and SubEthaEdit with light and dark modes
99
star
7

Mustache.mode

Mustache syntax mode for Coda and SubEthaEdit.
HTML
90
star
8

coda-cli

Makes Panic's Coda a first-class *nix citizen
Python
53
star
9

vagrant-mongobox

A simple little Vagrant box for running MongoDB
Puppet
51
star
10

Markdown.mode

A Markdown syntax mode file for Coda and SubEthaEdit.
40
star
11

Population

A simpler way to populate your Doctrine 2 databases.
PHP
37
star
12

coda-modes

A curated collection of syntax modes for Coda and SubEthaEdit.
35
star
13

Twig-HTML.mode

A Twig syntax mode for Coda and SubEthaEdit.
30
star
14

PHP-HTML.mode

A fork of Coda 1.x's PHP-HTML syntax mode. Doesn't work with 2.x :(
Perl
22
star
15

launchctl-completion

Bash completion support for OS X launchctl.
Shell
19
star
16

BobthecowMustacheBundle

Symfony2 + mustaches.
PHP
17
star
17

googlecl-completion

Bash completion support for googlecl.
Shell
15
star
18

copyonclick

A copyOnClick plugin for jQuery.
JavaScript
14
star
19

mustache-silex-provider

Mustache integration for the Silex application micro-framework.
PHP
14
star
20

GitX.codaplugin

This Coda plugin integrates Coda with GitX.
13
star
21

codaclips

A simple import/export script for Coda clips.
Shell
12
star
22

sublime-sniptastic

A quick and dirty snippet palette for Sublime Text 2.
Python
12
star
23

apprise-bootstrap

Stylish alerts for a Bootstrapped web.
JavaScript
11
star
24

heroku-buildpack-nanoc

ApacheConf
8
star
25

Twig-JavaScript.mode

A Twig (+JavaScript) syntax mode for Coda and SubEthaEdit.
7
star
26

CodaDocblock

Generate PHP Docblocks like magick!
Python
7
star
27

Gity.codaplugin

This Coda plugin integrates Coda with Gity, a sweet little Git client for OS X.
6
star
28

terminitor-completion

Bash completion support for terminitor.
Shell
6
star
29

forematter

The frontmatter-aware friend for your static site.
Ruby
6
star
30

ManipulateCoda

A text manipulation plug-in for Panic’s Coda
Python
5
star
31

homebrew-php

PHP formulae repo for Homebrew
Ruby
4
star
32

Twig-XML.mode

A Twig (+XML) syntax mode for Coda and SubEthaEdit.
4
star
33

genghisapp.com

This is the repo of the site of the app Genghis.
JavaScript
3
star
34

psysh.org

A website for a REPL for PHP
JavaScript
2
star
35

gist.codaplugin

Coda plugin utilizing gist.rb
2
star
36

psysh-mongodb

A MongoDB Plugin for PsySH
PHP
2
star