PluginProbe ʕ •ᴥ•ʔ
Kubio AI Page Builder / trunk
Kubio AI Page Builder vtrunk
2.9.0 2.8.6 2.8.5 2.8.4 2.8.3 2.8.2 2.8.1 trunk 1.0.0 1.0.1 1.1.0 1.2.0 1.2.1 1.2.2 1.2.3 1.3.0 1.3.1 1.3.2 1.4.0 1.4.1 1.4.2 1.4.3 1.5.0 1.6.0 1.6.1 1.6.2 1.6.3 1.6.4 1.7.0 1.7.1 1.7.2 1.7.3 1.8.0 1.8.1 1.8.2 1.9.0 2.0.0 2.1.1 2.1.2 2.1.3 2.2.0 2.2.3 2.2.4 2.2.5 2.3.0 2.3.1 2.3.3 2.3.4 2.4.0 2.4.1 2.4.2 2.4.3 2.4.5 2.5.0 2.5.1 2.5.2 2.5.3 2.6.0 2.6.1 2.6.2 2.6.3 2.6.5 2.6.6 2.6.7 2.7.0 2.7.1 2.7.2 2.7.3 2.8.0
kubio / vendor / fzaninotto / faker / readme.md
kubio / vendor / fzaninotto / faker Last commit date
.github 1 year ago .travis 1 year ago src 1 year ago CHANGELOG.md 1 year ago LICENSE 1 year ago composer.json 1 year ago readme.md 1 year ago
readme.md
1801 lines
1 # Faker
2
3 [](https://codecov.io/gh/fzaninotto/Faker![Code Coverage](https://codecov.io/gh/fzaninotto/Faker/branch/master/graph/badge.svg)](https://codecov.io/gh/fzaninotto/Faker](https://codecov.io/gh/fzaninotto/Faker)
4
5 Faker is a PHP library that generates fake data for you. Whether you need to bootstrap your database, create good-looking XML documents, fill-in your persistence to stress test it, or anonymize data taken from a production service, Faker is for you.
6
7 Faker is heavily inspired by Perl's [](http://search.cpan.org/~jasonk/Data-Faker-0.07/Data::Faker](http://search.cpan.org/~jasonk/Data-Faker-0.07/](http://search.cpan.org/~jasonk/Data-Faker-0.07/), and by ruby's [](https://rubygems.org/gems/fakerFaker](https://rubygems.org/gems/faker](https://rubygems.org/gems/faker).
8
9 Faker requires PHP >= 5.3.3.
10
11 [](https://packagist.org/packages/fzaninotto/faker![Monthly Downloads](https://poser.pugx.org/fzaninotto/faker/d/monthly.png)](https://packagist.org/packages/fzaninotto/faker](https://packagist.org/packages/fzaninotto/faker) [](https://travis-ci.org/fzaninotto/Faker![Build Status](https://travis-ci.org/fzaninotto/Faker.svg?branch=master)](https://travis-ci.org/fzaninotto/Faker](https://travis-ci.org/fzaninotto/Faker) [](https://insight.sensiolabs.com/projects/eceb78a9-38d4-4ad5-8b6b-b52f323e3549![SensioLabsInsight](https://insight.sensiolabs.com/projects/eceb78a9-38d4-4ad5-8b6b-b52f323e3549/mini.png)](https://insight.sensiolabs.com/projects/eceb78a9-38d4-4ad5-8b6b-b52f323e3549](https://insight.sensiolabs.com/projects/eceb78a9-38d4-4ad5-8b6b-b52f323e3549)
12
13 # Table of Contents
14
15 - [](#installationInstallation](#installation](#installation)
16 - [](#basic-usageBasic Usage](#basic-usage](#basic-usage)
17 - [](#formattersFormatters](#formatters](#formatters)
18 - [Base](#fakerproviderbase)
19 - [Lorem Ipsum Text](#fakerproviderlorem)
20 - [Person](#fakerprovideren_usperson)
21 - [Address](#fakerprovideren_usaddress)
22 - [Phone Number](#fakerprovideren_usphonenumber)
23 - [Company](#fakerprovideren_uscompany)
24 - [Real Text](#fakerprovideren_ustext)
25 - [Date and Time](#fakerproviderdatetime)
26 - [Internet](#fakerproviderinternet)
27 - [User Agent](#fakerprovideruseragent)
28 - [Payment](#fakerproviderpayment)
29 - [Color](#fakerprovidercolor)
30 - [File](#fakerproviderfile)
31 - [Image](#fakerproviderimage)
32 - [Uuid](#fakerprovideruuid)
33 - [Barcode](#fakerproviderbarcode)
34 - [Miscellaneous](#fakerprovidermiscellaneous)
35 - [Biased](#fakerproviderbiased)
36 - [Html Lorem](#fakerproviderhtmllorem)
37 - [](#modifiersModifiers](#modifiers](#modifiers)
38 - [](#localizationLocalization](#localization](#localization)
39 - [](#populating-entities-using-an-orm-or-an-odmPopulating Entities Using an ORM or an ODM](#populating-entities-using-an-orm-or-an-odm](#populating-entities-using-an-orm-or-an-odm)
40 - [](#seeding-the-generatorSeeding the Generator](#seeding-the-generator](#seeding-the-generator)
41 - [](#faker-internals-understanding-providersFaker Internals: Understanding Providers](#faker-internals-understanding-providers](#faker-internals-understanding-providers)
42 - [](#real-life-usageReal Life Usage](#real-life-usage](#real-life-usage)
43 - [](#language-specific-formattersLanguage specific formatters](#language-specific-formatters](#language-specific-formatters)
44 - [](#third-party-libraries-extendingbased-on-fakerThird-Party Libraries Extending/Based On Faker](#third-party-libraries-extendingbased-on-faker](#third-party-libraries-extendingbased-on-faker)
45 - [](#licenseLicense](#license](#license)
46
47
48 ## Installation
49
50 ```sh
51 composer require fzaninotto/faker
52 ```
53
54 ## Basic Usage
55
56 ### Autoloading
57
58 Faker supports both `PSR-0` as `PSR-4` autoloaders.
59 ```php
60 <?php
61 # When installed via composer
62 require_once 'vendor/autoload.php';
63 ```
64
65 You can also load `Fakers` shipped `PSR-0` autoloader
66 ```php
67 <?php
68 # Load Fakers own autoloader
69 require_once '/path/to/Faker/src/autoload.php';
70 ```
71
72 *alternatively, you can use any another PSR-4 compliant autoloader*
73
74 ### Create fake data
75 Use `Faker\Factory::create()` to create and initialize a faker generator, which can generate data by accessing properties named after the type of data you want.
76
77 ```php
78 <?php
79 // use the factory to create a Faker\Generator instance
80 $faker = Faker\Factory::create();
81
82 // generate data by accessing properties
83 echo $faker->name;
84 // 'Lucy Cechtelar';
85 echo $faker->address;
86 // "426 Jordy Lodge
87 // Cartwrightshire, SC 88120-6700"
88 echo $faker->text;
89 // Dolores sit sint laboriosam dolorem culpa et autem. Beatae nam sunt fugit
90 // et sit et mollitia sed.
91 // Fuga deserunt tempora facere magni omnis. Omnis quia temporibus laudantium
92 // sit minima sint.
93 ```
94
95 Even if this example shows a property access, each call to `$faker->name` yields a different (random) result. This is because Faker uses `__get()` magic, and forwards `Faker\Generator->$property` calls to `Faker\Generator->format($property)`.
96
97 ```php
98 <?php
99 for ($i = 0; $i < 10; $i++) {
100 echo $faker->name, "\n";
101 }
102 // Adaline Reichel
103 // Dr. Santa Prosacco DVM
104 // Noemy Vandervort V
105 // Lexi O'Conner
106 // Gracie Weber
107 // Roscoe Johns
108 // Emmett Lebsack
109 // Keegan Thiel
110 // Wellington Koelpin II
111 // Ms. Karley Kiehn V
112 ```
113
114 **Tip**: For a quick generation of fake data, you can also use Faker as a command line tool thanks to [faker-cli](https://github.com/bit3/faker-cli).
115
116 ## Formatters
117
118 Each of the generator properties (like `name`, `address`, and `lorem`) are called "formatters". A faker generator has many of them, packaged in "providers". Here is a list of the bundled formatters in the default locale.
119
120 ### `Faker\Provider\Base`
121
122 randomDigit // 7
123 randomDigitNot(5) // 0, 1, 2, 3, 4, 6, 7, 8, or 9
124 randomDigitNotNull // 5
125 randomNumber($nbDigits = NULL, $strict = false) // 79907610
126 randomFloat($nbMaxDecimals = NULL, $min = 0, $max = NULL) // 48.8932
127 numberBetween($min = 1000, $max = 9000) // 8567
128 randomLetter // 'b'
129 // returns randomly ordered subsequence of a provided array
130 randomElements($array = array ('a','b','c'), $count = 1) // array('c')
131 randomElement($array = array ('a','b','c')) // 'b'
132 shuffle('hello, world') // 'rlo,h eoldlw'
133 shuffle(array(1, 2, 3)) // array(2, 1, 3)
134 numerify('Hello ###') // 'Hello 609'
135 lexify('Hello ???') // 'Hello wgt'
136 bothify('Hello ##??') // 'Hello 42jz'
137 asciify('Hello ***') // 'Hello R6+'
138 regexify('[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}'); // sm0@y8k96a.ej
139
140 ### `Faker\Provider\Lorem`
141
142 word // 'aut'
143 words($nb = 3, $asText = false) // array('porro', 'sed', 'magni')
144 sentence($nbWords = 6, $variableNbWords = true) // 'Sit vitae voluptas sint non voluptates.'
145 sentences($nb = 3, $asText = false) // array('Optio quos qui illo error.', 'Laborum vero a officia id corporis.', 'Saepe provident esse hic eligendi.')
146 paragraph($nbSentences = 3, $variableNbSentences = true) // 'Ut ab voluptas sed a nam. Sint autem inventore aut officia aut aut blanditiis. Ducimus eos odit amet et est ut eum.'
147 paragraphs($nb = 3, $asText = false) // array('Quidem ut sunt et quidem est accusamus aut. Fuga est placeat rerum ut. Enim ex eveniet facere sunt.', 'Aut nam et eum architecto fugit repellendus illo. Qui ex esse veritatis.', 'Possimus omnis aut incidunt sunt. Asperiores incidunt iure sequi cum culpa rem. Rerum exercitationem est rem.')
148 text($maxNbChars = 200) // 'Fuga totam reiciendis qui architecto fugiat nemo. Consequatur recusandae qui cupiditate eos quod.'
149
150 ### `Faker\Provider\en_US\Person`
151
152 title($gender = null|'male'|'female') // 'Ms.'
153 titleMale // 'Mr.'
154 titleFemale // 'Ms.'
155 suffix // 'Jr.'
156 name($gender = null|'male'|'female') // 'Dr. Zane Stroman'
157 firstName($gender = null|'male'|'female') // 'Maynard'
158 firstNameMale // 'Maynard'
159 firstNameFemale // 'Rachel'
160 lastName // 'Zulauf'
161
162 ### `Faker\Provider\en_US\Address`
163
164 cityPrefix // 'Lake'
165 secondaryAddress // 'Suite 961'
166 state // 'NewMexico'
167 stateAbbr // 'OH'
168 citySuffix // 'borough'
169 streetSuffix // 'Keys'
170 buildingNumber // '484'
171 city // 'West Judge'
172 streetName // 'Keegan Trail'
173 streetAddress // '439 Karley Loaf Suite 897'
174 postcode // '17916'
175 address // '8888 Cummings Vista Apt. 101, Susanbury, NY 95473'
176 country // 'Falkland Islands (Malvinas)'
177 latitude($min = -90, $max = 90) // 77.147489
178 longitude($min = -180, $max = 180) // 86.211205
179
180 ### `Faker\Provider\en_US\PhoneNumber`
181
182 phoneNumber // '201-886-0269 x3767'
183 tollFreePhoneNumber // '(888) 937-7238'
184 e164PhoneNumber // '+27113456789'
185
186 ### `Faker\Provider\en_US\Company`
187
188 catchPhrase // 'Monitored regional contingency'
189 bs // 'e-enable robust architectures'
190 company // 'Bogan-Treutel'
191 companySuffix // 'and Sons'
192 jobTitle // 'Cashier'
193
194 ### `Faker\Provider\en_US\Text`
195
196 realText($maxNbChars = 200, $indexSize = 2) // "And yet I wish you could manage it?) 'And what are they made of?' Alice asked in a shrill, passionate voice. 'Would YOU like cats if you were never even spoke to Time!' 'Perhaps not,' Alice replied."
197
198 ### `Faker\Provider\DateTime`
199
200 unixTime($max = 'now') // 58781813
201 dateTime($max = 'now', $timezone = null) // DateTime('2008-04-25 08:37:17', 'UTC')
202 dateTimeAD($max = 'now', $timezone = null) // DateTime('1800-04-29 20:38:49', 'Europe/Paris')
203 iso8601($max = 'now') // '1978-12-09T10:10:29+0000'
204 date($format = 'Y-m-d', $max = 'now') // '1979-06-09'
205 time($format = 'H:i:s', $max = 'now') // '20:49:42'
206 dateTimeBetween($startDate = '-30 years', $endDate = 'now', $timezone = null) // DateTime('2003-03-15 02:00:49', 'Africa/Lagos')
207 dateTimeInInterval($startDate = '-30 years', $interval = '+ 5 days', $timezone = null) // DateTime('2003-03-15 02:00:49', 'Antartica/Vostok')
208 dateTimeThisCentury($max = 'now', $timezone = null) // DateTime('1915-05-30 19:28:21', 'UTC')
209 dateTimeThisDecade($max = 'now', $timezone = null) // DateTime('2007-05-29 22:30:48', 'Europe/Paris')
210 dateTimeThisYear($max = 'now', $timezone = null) // DateTime('2011-02-27 20:52:14', 'Africa/Lagos')
211 dateTimeThisMonth($max = 'now', $timezone = null) // DateTime('2011-10-23 13:46:23', 'Antarctica/Vostok')
212 amPm($max = 'now') // 'pm'
213 dayOfMonth($max = 'now') // '04'
214 dayOfWeek($max = 'now') // 'Friday'
215 month($max = 'now') // '06'
216 monthName($max = 'now') // 'January'
217 year($max = 'now') // '1993'
218 century // 'VI'
219 timezone // 'Europe/Paris'
220
221 Methods accepting a `$timezone` argument default to `date_default_timezone_get()`. You can pass a custom timezone string to each method, or define a custom timezone for all time methods at once using `$faker::setDefaultTimezone($timezone)`.
222
223 ### `Faker\Provider\Internet`
224
225 email // 'tkshlerin@collins.com'
226 safeEmail // 'king.alford@example.org'
227 freeEmail // 'bradley72@gmail.com'
228 companyEmail // 'russel.durward@mcdermott.org'
229 freeEmailDomain // 'yahoo.com'
230 safeEmailDomain // 'example.org'
231 userName // 'wade55'
232 password // 'k&|X+a45*2['
233 domainName // 'wolffdeckow.net'
234 domainWord // 'feeney'
235 tld // 'biz'
236 url // 'http://www.skilesdonnelly.biz/aut-accusantium-ut-architecto-sit-et.html'
237 slug // 'aut-repellat-commodi-vel-itaque-nihil-id-saepe-nostrum'
238 ipv4 // '109.133.32.252'
239 localIpv4 // '10.242.58.8'
240 ipv6 // '8e65:933d:22ee:a232:f1c1:2741:1f10:117c'
241 macAddress // '43:85:B7:08:10:CA'
242
243 ### `Faker\Provider\UserAgent`
244
245 userAgent // 'Mozilla/5.0 (Windows CE) AppleWebKit/5350 (KHTML, like Gecko) Chrome/13.0.888.0 Safari/5350'
246 chrome // 'Mozilla/5.0 (Macintosh; PPC Mac OS X 10_6_5) AppleWebKit/5312 (KHTML, like Gecko) Chrome/14.0.894.0 Safari/5312'
247 firefox // 'Mozilla/5.0 (X11; Linuxi686; rv:7.0) Gecko/20101231 Firefox/3.6'
248 safari // 'Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10_7_1 rv:3.0; en-US) AppleWebKit/534.11.3 (KHTML, like Gecko) Version/4.0 Safari/534.11.3'
249 opera // 'Opera/8.25 (Windows NT 5.1; en-US) Presto/2.9.188 Version/10.00'
250 internetExplorer // 'Mozilla/5.0 (compatible; MSIE 7.0; Windows 98; Win 9x 4.90; Trident/3.0)'
251
252 ### `Faker\Provider\Payment`
253
254 creditCardType // 'MasterCard'
255 creditCardNumber // '4485480221084675'
256 creditCardExpirationDate // 04/13
257 creditCardExpirationDateString // '04/13'
258 creditCardDetails // array('MasterCard', '4485480221084675', 'Aleksander Nowak', '04/13')
259 // Generates a random IBAN. Set $countryCode to null for a random country
260 iban($countryCode) // 'IT31A8497112740YZ575DJ28BP4'
261 swiftBicNumber // 'RZTIAT22263'
262
263 ### `Faker\Provider\Color`
264
265 hexcolor // '#fa3cc2'
266 rgbcolor // '0,255,122'
267 rgbColorAsArray // array(0,255,122)
268 rgbCssColor // 'rgb(0,255,122)'
269 safeColorName // 'fuchsia'
270 colorName // 'Gainsbor'
271 hslColor // '340,50,20'
272 hslColorAsArray // array(340,50,20)
273
274 ### `Faker\Provider\File`
275
276 fileExtension // 'avi'
277 mimeType // 'video/x-msvideo'
278 // Copy a random file from the source to the target directory and returns the fullpath or filename
279 file($sourceDir = '/tmp', $targetDir = '/tmp') // '/path/to/targetDir/13b73edae8443990be1aa8f1a483bc27.jpg'
280 file($sourceDir, $targetDir, false) // '13b73edae8443990be1aa8f1a483bc27.jpg'
281
282 ### `Faker\Provider\Image`
283
284 // Image generation provided by LoremPixel (http://lorempixel.com/)
285 imageUrl($width = 640, $height = 480) // 'http://lorempixel.com/640/480/'
286 imageUrl($width, $height, 'cats') // 'http://lorempixel.com/800/600/cats/'
287 imageUrl($width, $height, 'cats', true, 'Faker') // 'http://lorempixel.com/800/400/cats/Faker'
288 imageUrl($width, $height, 'cats', true, 'Faker', true) // 'http://lorempixel.com/gray/800/400/cats/Faker/' Monochrome image
289 image($dir = '/tmp', $width = 640, $height = 480) // '/tmp/13b73edae8443990be1aa8f1a483bc27.jpg'
290 image($dir, $width, $height, 'cats') // 'tmp/13b73edae8443990be1aa8f1a483bc27.jpg' it's a cat!
291 image($dir, $width, $height, 'cats', false) // '13b73edae8443990be1aa8f1a483bc27.jpg' it's a filename without path
292 image($dir, $width, $height, 'cats', true, false) // it's a no randomize images (default: `true`)
293 image($dir, $width, $height, 'cats', true, true, 'Faker') // 'tmp/13b73edae8443990be1aa8f1a483bc27.jpg' it's a cat with 'Faker' text. Default, `null`.
294
295 ### `Faker\Provider\Uuid`
296
297 uuid // '7e57d004-2b97-0e7a-b45f-5387367791cd'
298
299 ### `Faker\Provider\Barcode`
300
301 ean13 // '4006381333931'
302 ean8 // '73513537'
303 isbn13 // '9790404436093'
304 isbn10 // '4881416324'
305
306 ### `Faker\Provider\Miscellaneous`
307
308 boolean // false
309 boolean($chanceOfGettingTrue = 50) // true
310 md5 // 'de99a620c50f2990e87144735cd357e7'
311 sha1 // 'f08e7f04ca1a413807ebc47551a40a20a0b4de5c'
312 sha256 // '0061e4c60dac5c1d82db0135a42e00c89ae3a333e7c26485321f24348c7e98a5'
313 locale // en_UK
314 countryCode // UK
315 languageCode // en
316 currencyCode // EUR
317 emoji // 😁
318
319 ### `Faker\Provider\Biased`
320
321 // get a random number between 10 and 20,
322 // with more chances to be close to 20
323 biasedNumberBetween($min = 10, $max = 20, $function = 'sqrt')
324
325 ### `Faker\Provider\HtmlLorem`
326
327 //Generate HTML document which is no more than 2 levels deep, and no more than 3 elements wide at any level.
328 randomHtml(2,3) // <html><head><title>Aut illo dolorem et accusantium eum.</title></head><body><form action="example.com" method="POST"><label for="username">sequi</label><input type="text" id="username"><label for="password">et</label><input type="password" id="password"></form><b>Id aut saepe non mollitia voluptas voluptas.</b><table><thead><tr><tr>Non consequatur.</tr><tr>Incidunt est.</tr><tr>Aut voluptatem.</tr><tr>Officia voluptas rerum quo.</tr><tr>Asperiores similique.</tr></tr></thead><tbody><tr><td>Sapiente dolorum dolorem sint laboriosam commodi qui.</td><td>Commodi nihil nesciunt eveniet quo repudiandae.</td><td>Voluptates explicabo numquam distinctio necessitatibus repellat.</td><td>Provident ut doloremque nam eum modi aspernatur.</td><td>Iusto inventore.</td></tr><tr><td>Animi nihil ratione id mollitia libero ipsa quia tempore.</td><td>Velit est officia et aut tenetur dolorem sed mollitia expedita.</td><td>Modi modi repudiandae pariatur voluptas rerum ea incidunt non molestiae eligendi eos deleniti.</td><td>Exercitationem voluptatibus dolor est iste quod molestiae.</td><td>Quia reiciendis.</td></tr><tr><td>Inventore impedit exercitationem voluptatibus rerum cupiditate.</td><td>Qui.</td><td>Aliquam.</td><td>Autem nihil aut et.</td><td>Dolor ut quia error.</td></tr><tr><td>Enim facilis iusto earum et minus rerum assumenda quis quia.</td><td>Reprehenderit ut sapiente occaecati voluptatum dolor voluptatem vitae qui velit.</td><td>Quod fugiat non.</td><td>Sunt nobis totam mollitia sed nesciunt est deleniti cumque.</td><td>Repudiandae quo.</td></tr><tr><td>Modi dicta libero quisquam doloremque qui autem.</td><td>Voluptatem aliquid saepe laudantium facere eos sunt dolor.</td><td>Est eos quis laboriosam officia expedita repellendus quia natus.</td><td>Et neque delectus quod fugit enim repudiandae qui.</td><td>Fugit soluta sit facilis facere repellat culpa magni voluptatem maiores tempora.</td></tr><tr><td>Enim dolores doloremque.</td><td>Assumenda voluptatem eum perferendis exercitationem.</td><td>Quasi in fugit deserunt ea perferendis sunt nemo consequatur dolorum soluta.</td><td>Maxime repellat qui numquam voluptatem est modi.</td><td>Alias rerum rerum hic hic eveniet.</td></tr><tr><td>Tempore voluptatem.</td><td>Eaque.</td><td>Et sit quas fugit iusto.</td><td>Nemo nihil rerum dignissimos et esse.</td><td>Repudiandae ipsum numquam.</td></tr><tr><td>Nemo sunt quia.</td><td>Sint tempore est neque ducimus harum sed.</td><td>Dicta placeat atque libero nihil.</td><td>Et qui aperiam temporibus facilis eum.</td><td>Ut dolores qui enim et maiores nesciunt.</td></tr><tr><td>Dolorum totam sint debitis saepe laborum.</td><td>Quidem corrupti ea.</td><td>Cum voluptas quod.</td><td>Possimus consequatur quasi dolorem ut et.</td><td>Et velit non hic labore repudiandae quis.</td></tr></tbody></table></body></html>
329
330 ## Modifiers
331
332 Faker provides three special providers, `unique()`, `optional()`, and `valid()`, to be called before any provider.
333
334 ```php
335 // unique() forces providers to return unique values
336 $values = array();
337 for ($i = 0; $i < 10; $i++) {
338 // get a random digit, but always a new one, to avoid duplicates
339 $values []= $faker->unique()->randomDigit;
340 }
341 print_r($values); // [4, 1, 8, 5, 0, 2, 6, 9, 7, 3]
342
343 // providers with a limited range will throw an exception when no new unique value can be generated
344 $values = array();
345 try {
346 for ($i = 0; $i < 10; $i++) {
347 $values []= $faker->unique()->randomDigitNotNull;
348 }
349 } catch (\OverflowException $e) {
350 echo "There are only 9 unique digits not null, Faker can't generate 10 of them!";
351 }
352
353 // you can reset the unique modifier for all providers by passing true as first argument
354 $faker->unique($reset = true)->randomDigitNotNull; // will not throw OverflowException since unique() was reset
355 // tip: unique() keeps one array of values per provider
356
357 // optional() sometimes bypasses the provider to return a default value instead (which defaults to NULL)
358 $values = array();
359 for ($i = 0; $i < 10; $i++) {
360 // get a random digit, but also null sometimes
361 $values []= $faker->optional()->randomDigit;
362 }
363 print_r($values); // [1, 4, null, 9, 5, null, null, 4, 6, null]
364
365 // optional() accepts a weight argument to specify the probability of receiving the default value.
366 // 0 will always return the default value; 1 will always return the provider. Default weight is 0.5 (50% chance).
367 $faker->optional($weight = 0.1)->randomDigit; // 90% chance of NULL
368 $faker->optional($weight = 0.9)->randomDigit; // 10% chance of NULL
369
370 // optional() accepts a default argument to specify the default value to return.
371 // Defaults to NULL.
372 $faker->optional($weight = 0.5, $default = false)->randomDigit; // 50% chance of FALSE
373 $faker->optional($weight = 0.9, $default = 'abc')->word; // 10% chance of 'abc'
374
375 // valid() only accepts valid values according to the passed validator functions
376 $values = array();
377 $evenValidator = function($digit) {
378 return $digit % 2 === 0;
379 };
380 for ($i = 0; $i < 10; $i++) {
381 $values []= $faker->valid($evenValidator)->randomDigit;
382 }
383 print_r($values); // [0, 4, 8, 4, 2, 6, 0, 8, 8, 6]
384
385 // just like unique(), valid() throws an overflow exception when it can't generate a valid value
386 $values = array();
387 try {
388 $faker->valid($evenValidator)->randomElement(1, 3, 5, 7, 9);
389 } catch (\OverflowException $e) {
390 echo "Can't pick an even number in that set!";
391 }
392 ```
393
394 If you would like to use a modifier with a value not generated by Faker, use the `passthrough()` method. `passthrough()` simply returns whatever value it was given.
395
396 ```php
397 $faker->optional()->passthrough(mt_rand(5, 15));
398 ```
399
400 ## Localization
401
402 `Faker\Factory` can take a locale as an argument, to return localized data. If no localized provider is found, the factory fallbacks to the default locale (en_US).
403
404 ```php
405 <?php
406 $faker = Faker\Factory::create('fr_FR'); // create a French faker
407 for ($i = 0; $i < 10; $i++) {
408 echo $faker->name, "\n";
409 }
410 // Luce du Coulon
411 // Auguste Dupont
412 // Roger Le Voisin
413 // Alexandre Lacroix
414 // Jacques Humbert-Roy
415 // Thérèse Guillet-Andre
416 // Gilles Gros-Bodin
417 // Amélie Pires
418 // Marcel Laporte
419 // Geneviève Marchal
420 ```
421
422 You can check available Faker locales in the source code, [under the `Provider` directory](https://github.com/fzaninotto/Faker/tree/master/src/Faker/Provider). The localization of Faker is an ongoing process, for which we need your help. Don't hesitate to create localized providers to your own locale and submit a PR!
423
424 ## Populating Entities Using an ORM or an ODM
425
426 Faker provides adapters for Object-Relational and Object-Document Mappers (currently, [Propel](http://www.propelorm.org), [Doctrine2](http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/), [CakePHP](http://cakephp.org), [Spot2](https://github.com/vlucas/spot2), [Mandango](https://github.com/mandango/mandango) and [Eloquent](https://laravel.com/docs/master/eloquent) are supported). These adapters ease the population of databases through the Entity classes provided by an ORM library (or the population of document stores using Document classes provided by an ODM library).
427
428 To populate entities, create a new populator class (using a generator instance as parameter), then list the class and number of all the entities that must be generated. To launch the actual data population, call the `execute()` method.
429
430 Note that some of the `populators` could require additional parameters. As example the `doctrine` populator has an option to specify
431 its batchSize on how often it will flush the UnitOfWork to the database.
432
433 Here is an example showing how to populate 5 `Author` and 10 `Book` objects:
434
435 ```php
436 <?php
437 $generator = \Faker\Factory::create();
438 $populator = new \Faker\ORM\Propel\Populator($generator);
439 $populator->addEntity('Author', 5);
440 $populator->addEntity('Book', 10);
441 $insertedPKs = $populator->execute();
442 ```
443
444 The populator uses name and column type guessers to populate each column with relevant data. For instance, Faker populates a column named `first_name` using the `firstName` formatter, and a column with a `TIMESTAMP` type using the `dateTime` formatter. The resulting entities are therefore coherent. If Faker misinterprets a column name, you can still specify a custom closure to be used for populating a particular column, using the third argument to `addEntity()`:
445
446 ```php
447 <?php
448 $populator->addEntity('Book', 5, array(
449 'ISBN' => function() use ($generator) { return $generator->ean13(); }
450 ));
451 ```
452
453 In this example, Faker will guess a formatter for all columns except `ISBN`, for which the given anonymous function will be used.
454
455 **Tip**: To ignore some columns, specify `null` for the column names in the third argument of `addEntity()`. This is usually necessary for columns added by a behavior:
456
457 ```php
458 <?php
459 $populator->addEntity('Book', 5, array(
460 'CreatedAt' => null,
461 'UpdatedAt' => null,
462 ));
463 ```
464
465 Of course, Faker does not populate autoincremented primary keys. In addition, `Faker\ORM\Propel\Populator::execute()` returns the list of inserted PKs, indexed by class:
466
467 ```php
468 <?php
469 print_r($insertedPKs);
470 // array(
471 // 'Author' => (34, 35, 36, 37, 38),
472 // 'Book' => (456, 457, 458, 459, 470, 471, 472, 473, 474, 475)
473 // )
474 ```
475
476 **Note:** Due to the fact that `Faker` returns all the primary keys inserted, the memory consumption will go up drastically when you do batch inserts due to the big list of data.
477
478 In the previous example, the `Book` and `Author` models share a relationship. Since `Author` entities are populated first, Faker is smart enough to relate the populated `Book` entities to one of the populated `Author` entities.
479
480 Lastly, if you want to execute an arbitrary function on an entity before insertion, use the fourth argument of the `addEntity()` method:
481
482 ```php
483 <?php
484 $populator->addEntity('Book', 5, array(), array(
485 function($book) { $book->publish(); },
486 ));
487 ```
488
489 ## Seeding the Generator
490
491 You may want to get always the same generated data - for instance when using Faker for unit testing purposes. The generator offers a `seed()` method, which seeds the random number generator. Calling the same script twice with the same seed produces the same results.
492
493 ```php
494 <?php
495 $faker = Faker\Factory::create();
496 $faker->seed(1234);
497
498 echo $faker->name; // 'Jess Mraz I';
499 ```
500
501 > **Tip**: DateTime formatters won't reproduce the same fake data if you don't fix the `$max` value:
502 >
503 > ```php
504 > <?php
505 > // even when seeded, this line will return different results because $max varies
506 > $faker->dateTime(); // equivalent to $faker->dateTime($max = 'now')
507 > // make sure you fix the $max parameter
508 > $faker->dateTime('2014-02-25 08:37:17'); // will return always the same date when seeded
509 > ```
510 >
511 > **Tip**: Formatters won't reproduce the same fake data if you use the `rand()` php function. Use `$faker` or `mt_rand()` instead:
512 >
513 > ```php
514 > <?php
515 > // bad
516 > $faker->realText(rand(10,20));
517 > // good
518 > $faker->realText($faker->numberBetween(10,20));
519 > ```
520
521
522
523 ## Faker Internals: Understanding Providers
524
525 A `Faker\Generator` alone can't do much generation. It needs `Faker\Provider` objects to delegate the data generation to them. `Faker\Factory::create()` actually creates a `Faker\Generator` bundled with the default providers. Here is what happens under the hood:
526
527 ```php
528 <?php
529 $faker = new Faker\Generator();
530 $faker->addProvider(new Faker\Provider\en_US\Person($faker));
531 $faker->addProvider(new Faker\Provider\en_US\Address($faker));
532 $faker->addProvider(new Faker\Provider\en_US\PhoneNumber($faker));
533 $faker->addProvider(new Faker\Provider\en_US\Company($faker));
534 $faker->addProvider(new Faker\Provider\Lorem($faker));
535 $faker->addProvider(new Faker\Provider\Internet($faker));
536 ````
537
538 Whenever you try to access a property on the `$faker` object, the generator looks for a method with the same name in all the providers attached to it. For instance, calling `$faker->name` triggers a call to `Faker\Provider\Person::name()`. And since Faker starts with the last provider, you can easily override existing formatters: just add a provider containing methods named after the formatters you want to override.
539
540 That means that you can easily add your own providers to a `Faker\Generator` instance. A provider is usually a class extending `\Faker\Provider\Base`. This parent class allows you to use methods like `lexify()` or `randomNumber()`; it also gives you access to formatters of other providers, through the protected `$generator` property. The new formatters are the public methods of the provider class.
541
542 Here is an example provider for populating Book data:
543
544 ```php
545 <?php
546
547 namespace Faker\Provider;
548
549 class Book extends \Faker\Provider\Base
550 {
551 public function title($nbWords = 5)
552 {
553 $sentence = $this->generator->sentence($nbWords);
554 return substr($sentence, 0, strlen($sentence) - 1);
555 }
556
557 public function ISBN()
558 {
559 return $this->generator->ean13();
560 }
561 }
562 ```
563
564 To register this provider, just add a new instance of `\Faker\Provider\Book` to an existing generator:
565
566 ```php
567 <?php
568 $faker->addProvider(new \Faker\Provider\Book($faker));
569 ```
570
571 Now you can use the two new formatters like any other Faker formatter:
572
573 ```php
574 <?php
575 $book = new Book();
576 $book->setTitle($faker->title);
577 $book->setISBN($faker->ISBN);
578 $book->setSummary($faker->text);
579 $book->setPrice($faker->randomNumber(2));
580 ```
581
582 **Tip**: A provider can also be a Plain Old PHP Object. In that case, all the public methods of the provider become available to the generator.
583
584 ## Real Life Usage
585
586 The following script generates a valid XML document:
587
588 ```php
589 <?php
590 require_once '/path/to/Faker/src/autoload.php';
591 $faker = Faker\Factory::create();
592 ?>
593 <?xml version="1.0" encoding="UTF-8"?>
594 <contacts>
595 <?php for ($i = 0; $i < 10; $i++): ?>
596 <contact firstName="<?php echo $faker->firstName ?>" lastName="<?php echo $faker->lastName ?>" email="<?php echo $faker->email ?>">
597 <phone number="<?php echo $faker->phoneNumber ?>"/>
598 <?php if ($faker->boolean(25)): ?>
599 <birth date="<?php echo $faker->dateTimeThisCentury->format('Y-m-d') ?>" place="<?php echo $faker->city ?>"/>
600 <?php endif; ?>
601 <address>
602 <street><?php echo $faker->streetAddress ?></street>
603 <city><?php echo $faker->city ?></city>
604 <postcode><?php echo $faker->postcode ?></postcode>
605 <state><?php echo $faker->state ?></state>
606 </address>
607 <company name="<?php echo $faker->company ?>" catchPhrase="<?php echo $faker->catchPhrase ?>">
608 <?php if ($faker->boolean(33)): ?>
609 <offer><?php echo $faker->bs ?></offer>
610 <?php endif; ?>
611 <?php if ($faker->boolean(33)): ?>
612 <director name="<?php echo $faker->name ?>" />
613 <?php endif; ?>
614 </company>
615 <?php if ($faker->boolean(15)): ?>
616 <details>
617 <![CDATA[
618 <?php echo $faker->text(400) ?>
619 ]]>
620 </details>
621 <?php endif; ?>
622 </contact>
623 <?php endfor; ?>
624 </contacts>
625 ```
626
627 Running this script produces a document looking like:
628
629 ```xml
630 <?xml version="1.0" encoding="UTF-8"?>
631 <contacts>
632 <contact firstName="Ona" lastName="Bednar" email="schamberger.frank@wuckert.com">
633 <phone number="1-265-479-1196x714"/>
634 <address>
635 <street>182 Harrison Cove</street>
636 <city>North Lloyd</city>
637 <postcode>45577</postcode>
638 <state>Alabama</state>
639 </address>
640 <company name="Veum, Funk and Shanahan" catchPhrase="Function-based stable solution">
641 <offer>orchestrate compelling web-readiness</offer>
642 </company>
643 <details>
644 <![CDATA[
645 Alias accusantium voluptatum autem nobis cumque neque modi. Voluptatem error molestiae consequatur alias.
646 Illum commodi molestiae aut repellat id. Et sit consequuntur aut et ullam asperiores. Cupiditate culpa voluptatem et mollitia dolor. Nisi praesentium qui ut.
647 ]]>
648 </details>
649 </contact>
650 <contact firstName="Aurelie" lastName="Paucek" email="alfonzo55@durgan.com">
651 <phone number="863.712.1363x9425"/>
652 <address>
653 <street>90111 Hegmann Inlet</street>
654 <city>South Geovanymouth</city>
655 <postcode>69961-9311</postcode>
656 <state>Colorado</state>
657 </address>
658 <company name="Krajcik-Grimes" catchPhrase="Switchable cohesive instructionset">
659 </company>
660 </contact>
661 <contact firstName="Clifton" lastName="Kshlerin" email="kianna.wiegand@framiwyman.info">
662 <phone number="692-194-4746"/>
663 <address>
664 <street>9791 Nona Corner</street>
665 <city>Harberhaven</city>
666 <postcode>74062-8191</postcode>
667 <state>RhodeIsland</state>
668 </address>
669 <company name="Rosenbaum-Aufderhar" catchPhrase="Realigned asynchronous encryption">
670 </company>
671 </contact>
672 <contact firstName="Alexandre" lastName="Orn" email="thelma37@erdmancorwin.biz">
673 <phone number="189.655.8677x027"/>
674 <address>
675 <street>11161 Schultz Via</street>
676 <city>Feilstad</city>
677 <postcode>98019</postcode>
678 <state>NewJersey</state>
679 </address>
680 <company name="O'Hara-Prosacco" catchPhrase="Re-engineered solution-oriented algorithm">
681 <director name="Dr. Berenice Auer V" />
682 </company>
683 <details>
684 <![CDATA[
685 Ut itaque et quaerat doloremque eum praesentium. Rerum in saepe dolorem. Explicabo qui consequuntur commodi minima rem.
686 Harum temporibus rerum dolores. Non molestiae id dolorem placeat.
687 Aut asperiores nihil eius repellendus. Vero nihil corporis voluptatem explicabo commodi. Occaecati omnis blanditiis beatae quod aspernatur eos.
688 ]]>
689 </details>
690 </contact>
691 <contact firstName="Katelynn" lastName="Kohler" email="reinger.trudie@stiedemannjakubowski.com">
692 <phone number="(665)713-1657"/>
693 <address>
694 <street>6106 Nader Village Suite 753</street>
695 <city>McLaughlinstad</city>
696 <postcode>43189-8621</postcode>
697 <state>Missouri</state>
698 </address>
699 <company name="Herman-Tremblay" catchPhrase="Object-based explicit service-desk">
700 <offer>expedite viral synergies</offer>
701 <director name="Arden Deckow" />
702 </company>
703 </contact>
704 <contact firstName="Blanca" lastName="Stark" email="tad27@feest.net">
705 <phone number="168.719.4692x87177"/>
706 <address>
707 <street>7546 Kuvalis Plaza</street>
708 <city>South Wilfrid</city>
709 <postcode>77069</postcode>
710 <state>Georgia</state>
711 </address>
712 <company name="Upton, Braun and Rowe" catchPhrase="Visionary leadingedge pricingstructure">
713 </company>
714 </contact>
715 <contact firstName="Rene" lastName="Spencer" email="anibal28@armstrong.info">
716 <phone number="715.222.0095x175"/>
717 <birth date="2008-08-07" place="Zulaufborough"/>
718 <address>
719 <street>478 Daisha Landing Apt. 510</street>
720 <city>West Lizethhaven</city>
721 <postcode>30566-5362</postcode>
722 <state>WestVirginia</state>
723 </address>
724 <company name="Wiza Inc" catchPhrase="Persevering reciprocal approach">
725 <offer>orchestrate dynamic networks</offer>
726 <director name="Erwin Nienow" />
727 </company>
728 <details>
729 <![CDATA[
730 Dolorem consequatur voluptates unde optio unde. Accusantium dolorem est est architecto impedit. Corrupti et provident quo.
731 Reprehenderit dolores aut quidem suscipit repudiandae corporis error. Molestiae enim aperiam illo.
732 Et similique qui non expedita quia dolorum. Ex rem incidunt ea accusantium temporibus minus non.
733 ]]>
734 </details>
735 </contact>
736 <contact firstName="Alessandro" lastName="Hagenes" email="tbreitenberg@oharagorczany.com">
737 <phone number="1-284-958-6768"/>
738 <address>
739 <street>1251 Koelpin Mission</street>
740 <city>North Revastad</city>
741 <postcode>81620</postcode>
742 <state>Maryland</state>
743 </address>
744 <company name="Stiedemann-Bruen" catchPhrase="Re-engineered 24/7 success">
745 </company>
746 </contact>
747 <contact firstName="Novella" lastName="Rutherford" email="claud65@bogisich.biz">
748 <phone number="(091)825-7971"/>
749 <address>
750 <street>6396 Langworth Hills Apt. 446</street>
751 <city>New Carlos</city>
752 <postcode>89399-0268</postcode>
753 <state>Wyoming</state>
754 </address>
755 <company name="Stroman-Legros" catchPhrase="Expanded 4thgeneration moratorium">
756 <director name="Earlene Bayer" />
757 </company>
758 </contact>
759 <contact firstName="Andreane" lastName="Mann" email="meggie17@ornbaumbach.com">
760 <phone number="941-659-9982x5689"/>
761 <birth date="1934-02-21" place="Stantonborough"/>
762 <address>
763 <street>2246 Kreiger Station Apt. 291</street>
764 <city>Kaydenmouth</city>
765 <postcode>11397-1072</postcode>
766 <state>Wyoming</state>
767 </address>
768 <company name="Lebsack, Bernhard and Kiehn" catchPhrase="Persevering actuating framework">
769 <offer>grow sticky portals</offer>
770 </company>
771 <details>
772 <![CDATA[
773 Quia dolor ut quia error libero. Enim facilis iusto earum et minus rerum assumenda. Quia doloribus et reprehenderit ut. Occaecati voluptatum dolor voluptatem vitae qui velit quia.
774 Fugiat non in itaque sunt nobis totam. Sed nesciunt est deleniti cumque alias. Repudiandae quo aut numquam modi dicta libero.
775 ]]>
776 </details>
777 </contact>
778 </contacts>
779 ```
780
781 ## Language specific formatters
782
783 ### `Faker\Provider\ar_SA\Person`
784
785 ```php
786 <?php
787
788 echo $faker->idNumber; // ID number
789 echo $faker->nationalIdNumber // Citizen ID number
790 echo $faker->foreignerIdNumber // Foreigner ID number
791 echo $faker->companyIdNumber // Company ID number
792 ```
793
794 ### `Faker\Provider\ar_SA\Payment`
795
796 ```php
797 <?php
798
799 echo $faker->bankAccountNumber // "SA0218IBYZVZJSEC8536V4XC"
800 ```
801
802 ### `Faker\Provider\at_AT\Payment`
803
804 ```php
805 <?php
806
807 echo $faker->vat; // "AT U12345678" - Austrian Value Added Tax number
808 echo $faker->vat(false); // "ATU12345678" - unspaced Austrian Value Added Tax number
809 ```
810
811 ### `Faker\Provider\bg_BG\Payment`
812
813 ```php
814 <?php
815
816 echo $faker->vat; // "BG 0123456789" - Bulgarian Value Added Tax number
817 echo $faker->vat(false); // "BG0123456789" - unspaced Bulgarian Value Added Tax number
818 ```
819
820 ### `Faker\Provider\cs_CZ\Address`
821
822 ```php
823 <?php
824
825 echo $faker->region; // "Liberecký kraj"
826 ```
827
828 ### `Faker\Provider\cs_CZ\Company`
829
830 ```php
831 <?php
832
833 // Generates a valid IČO
834 echo $faker->ico; // "69663963"
835 ```
836
837 ### `Faker\Provider\cs_CZ\DateTime`
838
839 ```php
840 <?php
841
842 echo $faker->monthNameGenitive; // "prosince"
843 echo $faker->formattedDate; // "12. listopadu 2015"
844 ```
845
846 ### `Faker\Provider\cs_CZ\Person`
847
848 ```php
849 <?php
850
851 echo $faker->birthNumber; // "7304243452"
852 ```
853
854 ### `Faker\Provider\da_DK\Person`
855
856 ```php
857 <?php
858
859 // Generates a random CPR number
860 echo $faker->cpr; // "051280-2387"
861 ```
862
863 ### `Faker\Provider\da_DK\Address`
864
865 ```php
866 <?php
867
868 // Generates a random 'kommune' name
869 echo $faker->kommune; // "Frederiksberg"
870
871 // Generates a random region name
872 echo $faker->region; // "Region Sjælland"
873 ```
874
875 ### `Faker\Provider\da_DK\Company`
876
877 ```php
878 <?php
879
880 // Generates a random CVR number
881 echo $faker->cvr; // "32458723"
882
883 // Generates a random P number
884 echo $faker->p; // "5398237590"
885 ```
886
887 ### `Faker\Provider\de_CH\Person`
888 ```php
889 <?php
890
891 // Generates a random AVS13/AHV13 social security number
892 echo $faker->avs13; // "756.1234.5678.97" OR
893 echo $faker->ahv13; // "756.1234.5678.97"
894 ```
895
896 ### `Faker\Provider\de_DE\Payment`
897
898 ```php
899 <?php
900
901 echo $faker->bankAccountNumber; // "DE41849025553661169313"
902 echo $faker->bank; // "Volksbank Stuttgart"
903
904 ```
905
906 ### `Faker\Provider\en_HK\Address`
907
908 ```php
909 <?php
910
911 // Generates a fake town name based on the words commonly found in Hong Kong
912 echo $faker->town; // "Yuen Long"
913
914 // Generates a fake village name based on the words commonly found in Hong Kong
915 echo $faker->village; // "O Tau"
916
917 // Generates a fake estate name based on the words commonly found in Hong Kong
918 echo $faker->estate; // "Ching Lai Court"
919
920 ```
921
922 ### `Faker\Provider\en_HK\Phone`
923
924 ```php
925 <?php
926
927 // Generates a Hong Kong mobile number (starting with 5, 6 or 9)
928 echo $faker->mobileNumber; // "92150087"
929
930 // Generates a Hong Kong landline number (starting with 2 or 3)
931 echo $faker->landlineNumber; // "32750132"
932
933 // Generates a Hong Kong fax number (starting with 7)
934 echo $faker->faxNumber; // "71937729"
935
936 ```
937
938 ### `Faker\Provider\en_NG\Address`
939
940 ```php
941 <?php
942
943 // Generates a random region name
944 echo $faker->region; // 'Katsina'
945 ```
946
947 ### `Faker\Provider\en_NG\Person`
948
949 ```php
950 <?php
951
952 // Generates a random person name
953 echo $faker->name; // 'Oluwunmi Mayowa'
954 ```
955
956 ### `Faker\Provider\en_NZ\Phone`
957
958 ```php
959 <?php
960
961 // Generates a cell (mobile) phone number
962 echo $faker->mobileNumber; // "021 123 4567"
963
964 // Generates a toll free number
965 echo $faker->tollFreeNumber; // "0800 123 456"
966
967 // Area Code
968 echo $faker->areaCode; // "03"
969 ```
970
971 ### `Faker\Provider\en_US\Company`
972
973 ```php
974 <?php
975
976 // Generate a random Employer Identification Number
977 echo $faker->ein; // '12-3456789'
978 ```
979
980 ### `Faker\Provider\en_US\Payment`
981
982 ```php
983 <?php
984
985 echo $faker->bankAccountNumber; // '51915734310'
986 echo $faker->bankRoutingNumber; // '212240302'
987 ```
988
989 ### `Faker\Provider\en_US\Person`
990
991 ```php
992 <?php
993
994 // Generates a random Social Security Number
995 echo $faker->ssn; // '123-45-6789'
996 ```
997
998 ### `Faker\Provider\en_ZA\Company`
999
1000 ```php
1001 <?php
1002
1003 // Generates a random company registration number
1004 echo $faker->companyNumber; // 1999/789634/01
1005 ```
1006
1007 ### `Faker\Provider\en_ZA\Person`
1008
1009 ```php
1010 <?php
1011
1012 // Generates a random national identification number
1013 echo $faker->idNumber; // 6606192211041
1014
1015 // Generates a random valid licence code
1016 echo $faker->licenceCode; // EB
1017 ```
1018
1019 ### `Faker\Provider\en_ZA\PhoneNumber`
1020
1021 ```php
1022 <?php
1023
1024 // Generates a special rate toll free phone number
1025 echo $faker->tollFreeNumber; // 0800 555 5555
1026
1027 // Generates a mobile phone number
1028 echo $faker->mobileNumber; // 082 123 5555
1029 ```
1030
1031 ### `Faker\Provider\es_ES\Person`
1032
1033 ```php
1034 <?php
1035
1036 // Generates a Documento Nacional de Identidad (DNI) number
1037 echo $faker->dni; // '77446565E'
1038
1039 // Generates a random valid licence code
1040 echo $faker->licenceCode; // B
1041 ```
1042
1043 ### `Faker\Provider\es_ES\Payment`
1044
1045 ```php
1046 <?php
1047 // Generates a Código de identificación Fiscal (CIF) number
1048 echo $faker->vat; // "A35864370"
1049 ```
1050
1051 ### `Faker\Provider\es_ES\PhoneNumber`
1052
1053 ```php
1054 <?php
1055
1056 // Generates a special rate toll free phone number
1057 echo $faker->tollFreeNumber; // 900 123 456
1058
1059 // Generates a mobile phone number
1060 echo $faker->mobileNumber; // +34 612 12 24
1061 ```
1062
1063 ### `Faker\Provider\es_PE\Person`
1064
1065 ```php
1066 <?php
1067
1068 // Generates a Peruvian Documento Nacional de Identidad (DNI) number
1069 echo $faker->dni; // '83367512'
1070 ```
1071
1072 ### `Faker\Provider\fa_IR\Person`
1073
1074 ```php
1075 <?php
1076
1077 // Generates a valid nationalCode
1078 echo $faker->nationalCode; // "0078475759"
1079 ```
1080
1081 ### `Faker\Provider\fa_IR\Address`
1082
1083 ```php
1084 <?php
1085
1086 // Generates a random building name
1087 echo $faker->building; // "ساخت�
1088 ان آفتاب"
1089
1090 // Returns a random city name
1091 echo $faker->city // "استان زنجان"
1092 ```
1093
1094 ### `Faker\Provider\fa_IR\Company`
1095
1096 ```php
1097 <?php
1098
1099 // Generates a random contract type
1100 echo $faker->contract; // "رس�
1101 ی"
1102 ```
1103
1104 ### `Faker\Provider\fi_FI\Payment`
1105
1106 ```php
1107 <?php
1108
1109 // Generates a random bank account number
1110 echo $faker->bankAccountNumber; // "FI8350799879879616"
1111 ```
1112
1113 ### `Faker\Provider\fi_FI\Person`
1114
1115 ```php
1116 <?php
1117
1118 //Generates a valid Finnish personal identity number (in Finnish - Henkilötunnus)
1119 echo $faker->personalIdentityNumber() // '170974-007J'
1120
1121 //Since the numbers are different for male and female persons, optionally you can specify gender.
1122 echo $faker->personalIdentityNumber(\DateTime::createFromFormat('Y-m-d', '2015-12-14'), 'female') // '141215A520B'
1123 ```
1124
1125 ### `Faker\Provider\fr_BE\Payment`
1126
1127 ```php
1128 <?php
1129
1130 echo $faker->vat; // "BE 0123456789" - Belgian Value Added Tax number
1131 echo $faker->vat(false); // "BE0123456789" - unspaced Belgian Value Added Tax number
1132 ```
1133
1134 ### `Faker\Provider\es_VE\Person`
1135
1136 ```php
1137 <?php
1138
1139 // Generate a Cédula de identidad number, you can pass one argument to add separator
1140 echo $faker->nationalId; // 'V11223344'
1141 ```
1142
1143 ### `Faker\Provider\es_VE\Company`
1144
1145 ```php
1146 <?php
1147
1148 // Generates a R.I.F. number, you can pass one argument to add separators
1149 echo $faker->taxpayerIdentificationNumber; // 'J1234567891'
1150 ```
1151
1152 ### `Faker\Provider\fr_CH\Person`
1153 ```php
1154 <?php
1155
1156 // Generates a random AVS13/AHV13 social security number
1157 echo $faker->avs13; // "756.1234.5678.97"
1158 ```
1159
1160 ### `Faker\Provider\fr_FR\Address`
1161
1162 ```php
1163 <?php
1164
1165 // Generates a random department name
1166 echo $faker->departmentName; // "Haut-Rhin"
1167
1168 // Generates a random department number
1169 echo $faker->departmentNumber; // "2B"
1170
1171 // Generates a random department info (department number => department name)
1172 $faker->department; // array('18' => 'Cher');
1173
1174 // Generates a random region
1175 echo $faker->region; // "Saint-Pierre-et-Miquelon"
1176
1177 // Generates a random appartement,stair
1178 echo $faker->secondaryAddress; // "Bat. 961"
1179 ```
1180
1181 ### `Faker\Provider\fr_FR\Company`
1182
1183 ```php
1184 <?php
1185
1186 // Generates a random SIREN number
1187 echo $faker->siren; // 082 250 104
1188
1189 // Generates a random SIRET number
1190 echo $faker->siret; // 347 355 708 00224
1191 ```
1192
1193 ### `Faker\Provider\fr_FR\Payment`
1194
1195 ```php
1196 <?php
1197
1198 // Generates a random VAT
1199 echo $faker->vat; // FR 12 123 456 789
1200 ```
1201
1202 ### `Faker\Provider\fr_FR\Person`
1203
1204 ```php
1205 <?php
1206
1207 // Generates a random NIR / Sécurité Sociale number
1208 echo $faker->nir; // 1 88 07 35 127 571 - 19
1209 ```
1210
1211 ### `Faker\Provider\fr_FR\PhoneNumber`
1212
1213 ```php
1214 <?php
1215
1216 // Generates phone numbers
1217 echo $faker->phoneNumber; // +33 (0)1 67 97 01 31
1218 echo $faker->mobileNumber; // +33 6 21 12 72 84
1219 echo $faker->serviceNumber // 08 98 04 84 46
1220 ```
1221
1222
1223 ### `Faker\Provider\he_IL\Payment`
1224
1225 ```php
1226 <?php
1227
1228 echo $faker->bankAccountNumber // "IL392237392219429527697"
1229 ```
1230
1231 ### `Faker\Provider\hr_HR\Payment`
1232
1233 ```php
1234 <?php
1235
1236 echo $faker->bankAccountNumber // "HR3789114847226078672"
1237 ```
1238
1239 ### `Faker\Provider\hu_HU\Payment`
1240
1241 ```php
1242 <?php
1243
1244 // Generates a random bank account number
1245 echo $faker->bankAccountNumber; // "HU09904437680048220079300783"
1246 ```
1247
1248 ### `Faker\Provider\id_ID\Person`
1249
1250 ```php
1251 <?php
1252
1253 // Generates a random Nomor Induk Kependudukan (NIK)
1254
1255 // first argument is gender, either Person::GENDER_MALE or Person::GENDER_FEMALE, if none specified random gender is used
1256 // second argument is birth date (DateTime object), if none specified, random birth date is used
1257 echo $faker->nik(); // "8522246001570940"
1258 ```
1259
1260 ### `Faker\Provider\it_CH\Person`
1261 ```php
1262 <?php
1263
1264 // Generates a random AVS13/AHV13 social security number
1265 echo $faker->avs13; // "756.1234.5678.97"
1266 ```
1267
1268 ### `Faker\Provider\it_IT\Company`
1269
1270 ```php
1271 <?php
1272
1273 // Generates a random Vat Id
1274 echo $faker->vatId(); // "IT98746784967"
1275 ```
1276
1277 ### `Faker\Provider\it_IT\Person`
1278
1279 ```php
1280 <?php
1281
1282 // Generates a random Tax Id code (Codice fiscale)
1283 echo $faker->taxId(); // "DIXDPZ44E08F367A"
1284 ```
1285
1286 ### `Faker\Provider\ja_JP\Person`
1287
1288 ```php
1289 <?php
1290
1291 // Generates a 'kana' name
1292 echo $faker->kanaName($gender = null|'male'|'female') // "アオタ ミノル"
1293
1294 // Generates a 'kana' first name
1295 echo $faker->firstKanaName($gender = null|'male'|'female') // "ヒデキ"
1296
1297 // Generates a 'kana' first name on the male
1298 echo $faker->firstKanaNameMale // "ヒデキ"
1299
1300 // Generates a 'kana' first name on the female
1301 echo $faker->firstKanaNameFemale // "マアヤ"
1302
1303 // Generates a 'kana' last name
1304 echo $faker->lastKanaName; // "ナカジマ"
1305 ```
1306
1307 ### `Faker\Provider\ka_GE\Payment`
1308
1309 ```php
1310 <?php
1311
1312 // Generates a random bank account number
1313 echo $faker->bankAccountNumber; // "GE33ZV9773853617253389"
1314 ```
1315
1316 ### `Faker\Provider\kk_KZ\Company`
1317
1318 ```php
1319 <?php
1320
1321 // Generates an business identification number
1322 echo $faker->businessIdentificationNumber; // "150140000019"
1323 ```
1324
1325 ### `Faker\Provider\kk_KZ\Payment`
1326
1327 ```php
1328 <?php
1329
1330 // Generates a random bank name
1331 echo $faker->bank; // "Қазкоммерцбанк"
1332
1333 // Generates a random bank account number
1334 echo $faker->bankAccountNumber; // "KZ1076321LO4H6X41I37"
1335 ```
1336
1337 ### `Faker\Provider\kk_KZ\Person`
1338
1339 ```php
1340 <?php
1341
1342 // Generates an individual identification number
1343 echo $faker->individualIdentificationNumber; // "780322300455"
1344
1345 // Generates an individual identification number based on his/her birth date
1346 echo $faker->individualIdentificationNumber(new \DateTime('1999-03-01')); // "990301300455"
1347 ```
1348
1349 ### `Faker\Provider\ko_KR\Address`
1350
1351 ```php
1352 <?php
1353
1354 // Generates a metropolitan city
1355 echo $faker->metropolitanCity; // "서울특별시"
1356
1357 // Generates a borough
1358 echo $faker->borough; // "강남구"
1359 ```
1360
1361 ### `Faker\Provider\ko_KR\PhoneNumber`
1362
1363 ```php
1364 <?php
1365
1366 // Generates a local area phone numer
1367 echo $faker->localAreaPhoneNumber; // "02-1234-4567"
1368
1369 // Generates a cell phone number
1370 echo $faker->cellPhoneNumber; // "010-9876-5432"
1371 ```
1372
1373 ### `Faker\Provider\lt_LT\Payment`
1374
1375 ```php
1376 <?php
1377
1378 echo $faker->bankAccountNumber // "LT300848876740317118"
1379 ```
1380
1381 ### `Faker\Provider\lv_LV\Person`
1382
1383 ```php
1384 <?php
1385
1386 // Generates a random personal identity card number
1387 echo $faker->personalIdentityNumber; // "140190-12301"
1388 ```
1389
1390 ### `Faker\Provider\ms_MY\Address`
1391
1392 ```php
1393 <?php
1394
1395 // Generates a random Malaysian township
1396 echo $faker->township; // "Taman Bahagia"
1397
1398 // Generates a random Malaysian town address with matching postcode and state
1399 echo $faker->townState; // "55100 Bukit Bintang, Kuala Lumpur"
1400 ```
1401
1402 ### `Faker\Provider\ms_MY\Miscellaneous`
1403
1404 ```php
1405 <?php
1406
1407 // Generates a random vehicle license plate number
1408 echo $faker->jpjNumberPlate; // "WPL 5169"
1409 ```
1410
1411 ### `Faker\Provider\ms_MY\Payment`
1412
1413 ```php
1414 <?php
1415
1416 // Generates a random Malaysian bank
1417 echo $faker->bank; // "Maybank"
1418
1419 // Generates a random Malaysian bank account number (10-16 digits)
1420 echo $faker->bankAccountNumber; // "1234567890123456"
1421
1422 // Generates a random Malaysian insurance company
1423 echo $faker->insurance; // "AIA Malaysia"
1424
1425 // Generates a random Malaysian bank SWIFT Code
1426 echo $faker->swiftCode; // "MBBEMYKLXXX"
1427 ```
1428
1429 ### `Faker\Provider\ms_MY\Person`
1430
1431 ```php
1432 <?php
1433
1434 // Generates a random personal identity card (myKad) number
1435 echo $faker->myKadNumber($gender = null|'male'|'female', $hyphen = null|true|false); // "710703471796"
1436 ```
1437
1438 ### `Faker\Provider\ms_MY\PhoneNumber`
1439
1440 ```php
1441 <?php
1442
1443 // Generates a random Malaysian mobile number
1444 echo $faker->mobileNumber($countryCodePrefix = null|true|false, $formatting = null|true|false); // "+6012-705 3767"
1445
1446 // Generates a random Malaysian landline number
1447 echo $faker->fixedLineNumber($countryCodePrefix = null|true|false, $formatting = null|true|false); // "03-7112 0455"
1448
1449 // Generates a random Malaysian voip number
1450 echo $faker->voipNumber($countryCodePrefix = null|true|false, $formatting = null|true|false); // "015-458 7099"
1451 ```
1452
1453 ### `Faker\Provider\ne_NP\Address`
1454
1455 ```php
1456 <?php
1457
1458 //Generates a Nepali district name
1459 echo $faker->district;
1460
1461 //Generates a Nepali city name
1462 echo $faker->cityName;
1463 ```
1464
1465 ### `Faker\Provider\nl_BE\Payment`
1466
1467 ```php
1468 <?php
1469
1470 echo $faker->vat; // "BE 0123456789" - Belgian Value Added Tax number
1471 echo $faker->vat(false); // "BE0123456789" - unspaced Belgian Value Added Tax number
1472 ```
1473
1474 ### `Faker\Provider\nl_BE\Person`
1475
1476 ```php
1477 <?php
1478
1479 echo $faker->rrn(); // "83051711784" - Belgian Rijksregisternummer
1480 echo $faker->rrn('female'); // "50032089858" - Belgian Rijksregisternummer for a female
1481 ```
1482
1483 ### `Faker\Provider\nl_NL\Company`
1484
1485 ```php
1486 <?php
1487
1488 echo $faker->jobTitle; // "Houtbewerker"
1489 echo $faker->vat; // "NL123456789B01" - Dutch Value Added Tax number
1490 echo $faker->btw; // "NL123456789B01" - Dutch Value Added Tax number (alias)
1491 ```
1492
1493 ### `Faker\Provider\nl_NL\Person`
1494
1495 ```php
1496 <?php
1497
1498 echo $faker->idNumber; // "111222333" - Dutch Personal identification number (BSN)
1499 ```
1500
1501 ### `Faker\Provider\nb_NO\MobileNumber`
1502
1503 ```php
1504 <?php
1505
1506 // Generates a random Norwegian mobile phone number
1507 echo $faker->mobileNumber; // "+4799988777"
1508 echo $faker->mobileNumber; // "999 88 777"
1509 echo $faker->mobileNumber; // "99988777"
1510 ```
1511
1512 ### `Faker\Provider\nb_NO\Payment`
1513
1514 ```php
1515 <?php
1516
1517 // Generates a random bank account number
1518 echo $faker->bankAccountNumber; // "NO3246764709816"
1519 ```
1520
1521 ### `Faker\Provider\pl_PL\Person`
1522
1523 ```php
1524 <?php
1525
1526 // Generates a random PESEL number
1527 echo $faker->pesel; // "40061451555"
1528 // Generates a random personal identity card number
1529 echo $faker->personalIdentityNumber; // "AKX383360"
1530 // Generates a random taxpayer identification number (NIP)
1531 echo $faker->taxpayerIdentificationNumber; // '8211575109'
1532 ```
1533
1534 ### `Faker\Provider\pl_PL\Company`
1535
1536 ```php
1537 <?php
1538
1539 // Generates a random REGON number
1540 echo $faker->regon; // "714676680"
1541 // Generates a random local REGON number
1542 echo $faker->regonLocal; // "15346111382836"
1543 ```
1544
1545 ### `Faker\Provider\pl_PL\Payment`
1546
1547 ```php
1548 <?php
1549
1550 // Generates a random bank name
1551 echo $faker->bank; // "Narodowy Bank Polski"
1552 // Generates a random bank account number
1553 echo $faker->bankAccountNumber; // "PL14968907563953822118075816"
1554 ```
1555
1556 ### `Faker\Provider\pt_PT\Person`
1557
1558 ```php
1559 <?php
1560
1561 // Generates a random taxpayer identification number (in portuguese - Número de Identificação Fiscal NIF)
1562 echo $faker->taxpayerIdentificationNumber; // '165249277'
1563 ```
1564
1565 ### `Faker\Provider\pt_BR\Address`
1566
1567 ```php
1568 <?php
1569
1570 // Generates a random region name
1571 echo $faker->region; // 'Nordeste'
1572
1573 // Generates a random region abbreviation
1574 echo $faker->regionAbbr; // 'NE'
1575 ```
1576
1577 ### `Faker\Provider\pt_BR\PhoneNumber`
1578
1579 ```php
1580 <?php
1581
1582 echo $faker->areaCode; // 21
1583 echo $faker->cellphone; // 9432-5656
1584 echo $faker->landline; // 2654-3445
1585 echo $faker->phone; // random landline, 8-digit or 9-digit cellphone number
1586
1587 // Using the phone functions with a false argument returns unformatted numbers
1588 echo $faker->cellphone(false); // 74336667
1589
1590 // cellphone() has a special second argument to add the 9th digit. Ignored if generated a Radio number
1591 echo $faker->cellphone(true, true); // 98983-3945 or 7343-1290
1592
1593 // Using the "Number" suffix adds area code to the phone
1594 echo $faker->cellphoneNumber; // (11) 98309-2935
1595 echo $faker->landlineNumber(false); // 3522835934
1596 echo $faker->phoneNumber; // formatted, random landline or cellphone (obeying the 9th digit rule)
1597 echo $faker->phoneNumberCleared; // not formatted, random landline or cellphone (obeying the 9th digit rule)
1598 ```
1599
1600 ### `Faker\Provider\pt_BR\Person`
1601
1602 ```php
1603 <?php
1604
1605 // The name generator may include double first or double last names, plus title and suffix
1606 echo $faker->name; // 'Sr. Luis Adriano Sepúlveda Filho'
1607
1608 // Valid document generators have a boolean argument to remove formatting
1609 echo $faker->cpf; // '145.343.345-76'
1610 echo $faker->cpf(false); // '45623467866'
1611 echo $faker->rg; // '84.405.736-3'
1612 echo $faker->rg(false); // '844057363'
1613 ```
1614
1615 ### `Faker\Provider\pt_BR\Company`
1616
1617 ```php
1618 <?php
1619
1620 // Generates a Brazilian formatted and valid CNPJ
1621 echo $faker->cnpj; // '23.663.478/0001-24'
1622 echo $faker->cnpj(false); // '23663478000124'
1623 ```
1624
1625 ### `Faker\Provider\ro_MD\Payment`
1626
1627 ```php
1628 <?php
1629
1630 // Generates a random bank account number
1631 echo $faker->bankAccountNumber; // "MD83BQW1CKMUW34HBESDP3A8"
1632 ```
1633
1634 ### `Faker\Provider\ro_RO\Payment`
1635
1636 ```php
1637 <?php
1638
1639 // Generates a random bank account number
1640 echo $faker->bankAccountNumber; // "RO55WRJE3OE8X3YQI7J26U1E"
1641 ```
1642
1643 ### `Faker\Provider\ro_RO\Person`
1644
1645 ```php
1646 <?php
1647
1648 // Generates a random male name prefix/title
1649 echo $faker->prefixMale; // "ing."
1650 // Generates a random female name prefix/title
1651 echo $faker->prefixFemale; // "d-na."
1652 // Generates a random male first name
1653 echo $faker->firstNameMale; // "Adrian"
1654 // Generates a random female first name
1655 echo $faker->firstNameFemale; // "Miruna"
1656
1657
1658 // Generates a random Personal Numerical Code (CNP)
1659 echo $faker->cnp; // "2800523081231"
1660 // Valid option values:
1661 // $gender: null (random), male, female
1662 // $dateOfBirth (1800+): null (random), Y-m-d, Y-m (random day), Y (random month and day)
1663 // i.e. '1981-06-16', '2015-03', '1900'
1664 // $county: 2 letter ISO 3166-2:RO county codes and B1, B2, B3, B4, B5, B6 for Bucharest's 6 sectors
1665 // $isResident true/false flag if the person resides in Romania
1666 echo $faker->cnp($gender = null, $dateOfBirth = null, $county = null, $isResident = true);
1667
1668 ```
1669
1670 ### `Faker\Provider\ro_RO\PhoneNumber`
1671
1672 ```php
1673 <?php
1674
1675 // Generates a random toll-free phone number
1676 echo $faker->tollFreePhoneNumber; // "0800123456"
1677 // Generates a random premium-rate phone number
1678 echo $faker->premiumRatePhoneNumber; // "0900123456"
1679 ```
1680
1681 ### `Faker\Provider\ru_RU\Payment`
1682
1683 ```php
1684 <?php
1685
1686 // Generates a Russian bank name (based on list of real russian banks)
1687 echo $faker->bank; // "ОТП Банк"
1688
1689 //Generate a Russian Tax Payment Number for Company
1690 echo $faker->inn; // 7813540735
1691
1692 //Generate a Russian Tax Code for Company
1693 echo $faker->kpp; // 781301001
1694 ```
1695
1696 ### `Faker\Provider\sv_SE\Payment`
1697
1698 ```php
1699 <?php
1700
1701 // Generates a random bank account number
1702 echo $faker->bankAccountNumber; // "SE5018548608468284909192"
1703 ```
1704
1705 ### `Faker\Provider\sv_SE\Person`
1706
1707 ```php
1708 <?php
1709
1710 //Generates a valid Swedish personal identity number (in Swedish - Personnummer)
1711 echo $faker->personalIdentityNumber() // '950910-0799'
1712
1713 //Since the numbers are different for male and female persons, optionally you can specify gender.
1714 echo $faker->personalIdentityNumber('female') // '950910-0781'
1715 ```
1716 ### `Faker\Provider\tr_TR\Person`
1717
1718 ```php
1719 <?php
1720
1721 //Generates a valid Turkish identity number (in Turkish - T.C. Kimlik No)
1722 echo $faker->tcNo // '55300634882'
1723
1724 ```
1725
1726
1727 ### `Faker\Provider\zh_CN\Payment`
1728
1729 ```php
1730 <?php
1731
1732 // Generates a random bank name (based on list of real chinese banks)
1733 echo $faker->bank; // '中国建设银行'
1734 ```
1735
1736 ### `Faker\Provider\uk_UA\Payment`
1737
1738 ```php
1739 <?php
1740
1741 // Generates an Ukraine bank name (based on list of real Ukraine banks)
1742 echo $faker->bank; // "Ощадбанк"
1743 ```
1744
1745 ### `Faker\Provider\zh_TW\Person`
1746
1747 ```php
1748 <?php
1749
1750 // Generates a random personal identify number
1751 echo $faker->personalIdentityNumber; // A223456789
1752 ```
1753
1754 ### `Faker\Provider\zh_TW\Company`
1755
1756 ```php
1757 <?php
1758
1759 // Generates a random VAT / Company Tax number
1760 echo $faker->VAT; //23456789
1761 ```
1762
1763
1764 ## Third-Party Libraries Extending/Based On Faker
1765
1766 * Symfony bundles:
1767 * [`willdurand/faker-bundle`](https://github.com/willdurand/BazingaFakerBundle): Put the awesome Faker library into the Symfony2 DIC and populate your database with fake data.
1768 * [`hautelook/alice-bundle`](https://github.com/hautelook/AliceBundle), [`h4cc/alice-fixtures-bundle`](https://github.com/h4cc/AliceFixturesBundle): Bundles for using [`nelmio/alice`](https://packagist.org/packages/nelmio/alice) and Faker with data fixtures. Able to use Doctrine ORM as well as Doctrine MongoDB ODM.
1769 * [`emanueleminotto/faker-service-provider`](https://github.com/EmanueleMinotto/FakerServiceProvider): Faker Service Provider for Silex
1770 * [`bit3/faker-cli`](https://github.com/bit3/faker-cli): Command Line Tool for the Faker PHP library
1771 * [`league/factory-muffin`](https://github.com/thephpleague/factory-muffin): enable the rapid creation of objects (PHP port of factory-girl)
1772 * [`fzaninotto/company-name-generator`](https://github.com/fzaninotto/CompanyNameGenerator): Generate names for English tech companies with class
1773 * [`emanueleminotto/faker-placehold-it-provider`](https://github.com/EmanueleMinotto/PlaceholdItProvider): Generate images using placehold.it
1774 * [`spyrit/datalea`](https://github.com/spyrit/datalea) A highly customizable random test data generator web app
1775 * [`frequenc1/newage-ipsum`](https://github.com/frequenc1/newage-ipsum): A new aged ipsum provider for the faker library inspired by http://sebpearce.com/bullshit/
1776 * [`prewk/xml-faker`](https://github.com/prewk/xml-faker): Create fake XML with Faker
1777 * [`denheck/faker-context`](https://github.com/denheck/faker-context): Behat context using Faker to generate testdata
1778 * [`swekaj/cron-expression-generator`](https://github.com/swekaj/CronExpressionGenerator): Faker provider for generating random, valid cron expressions.
1779 * [`pragmafabrik/pomm-faker`](https://github.com/pragmafabrik/Pomm2Faker): Faker client for Pomm database framework (PostgreSQL)
1780 * [`nelmio/alice`](https://github.com/nelmio/alice): Fixtures/object generator with a yaml DSL that can use Faker as data generator.
1781 * [`ravage84/cakephp-fake-seeder`](https://github.com/ravage84/cakephp-fake-seeder) A CakePHP 2.x shell to seed your database with fake and/or fixed data.
1782 * [`bheller/images-generator`](https://github.com/bruceheller/images-generator): An image generator provider using GD for placeholder type pictures
1783 * [`pattern-lab/plugin-faker`](https://github.com/pattern-lab/plugin-php-faker): Pattern Lab is a Styleguide, Component Library, and Prototyping tool. This creates unique content each time Pattern Lab is generated.
1784 * [`guidocella/eloquent-populator`](https://github.com/guidocella/eloquent-populator): Adapter for Laravel's Eloquent ORM.
1785 * [`tamperdata/exiges`](https://github.com/tamperdata/exiges): Faker provider for generating random temperatures
1786 * [`jzonta/faker-restaurant`](https://github.com/jzonta/FakerRestaurant): Faker for Food and Beverage names generate
1787 * [`aalaap/faker-youtube`](https://github.com/aalaap/faker-youtube): Faker for YouTube URLs in various formats
1788 * [`pelmered/fake-car`](https://github.com/pelmered/fake-car): Faker for cars and car data
1789 * [`bluemmb/faker-picsum-photos-provider`](https://github.com/bluemmb/Faker-PicsumPhotos): Generate images using [picsum.photos](http://picsum.photos/)
1790 * [`er1z/fakemock`](https://github.com/er1z/fakemock): Generate mocks using class-configuration and detection via Faker's guesser and Symfony asserts
1791 * [`xvladqt/faker-lorem-flickr`](https://github.com/xvladxtremal/Faker-LoremFlickr): Generate images using [loremflickr.com](http://loremflickr.com/)
1792 * [`metrakit/faker-eddy-malou`](https://github.com/Metrakit/faker-eddy-malou): Generate French Eddy Malou sentences & paragraphs
1793 * [`drupol/belgian-national-number-faker`](https://github.com/drupol/belgian-national-number-faker): Generate fake Belgian national numbers
1794 * [`elgentos/masquerade`](https://github.com/elgentos/masquerade): Configuration-based, platform-agnostic, locale-compatible data faker tool (out-of-the-box support for Magento 2)
1795 * [`ottaviano/faker-gravatar`](https://github.com/ottaviano/faker-gravatar): Generate avatars using [Gravatar](https://en.gravatar.com/site/implement/images/)
1796 * [`finwe/phpstan-faker`](https://github.com/finwe/phpstan-faker): PHPStan extension for Faker methods
1797
1798 ## License
1799
1800 Faker is released under the MIT License. See the bundled LICENSE file for details.
1801