Skip to content

Instantly share code, notes, and snippets.

@niladam
Forked from rashidlaasri/helpers.php
Created January 26, 2020 17:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save niladam/a41ffde146aefcd3ca9388b203cbd85f to your computer and use it in GitHub Desktop.
Save niladam/a41ffde146aefcd3ca9388b203cbd85f to your computer and use it in GitHub Desktop.
<?php
function faker($property = null)
{
$faker = Faker\Factory::create();
if ($property) {
return $faker->{$property};
}
return $faker;
}
// Usage:
faker()->name;
faker()->year();
faker('safeEmail');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment