Created
January 26, 2020 13:48
-
-
Save rashidlaasri/f93bb413a152b6e164c2d7df977e87d6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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