Created
January 26, 2017 17:07
-
-
Save madeinnordeste/9d0bb3fd3485e962b135b603c4546fe4 to your computer and use it in GitHub Desktop.
Laravel 5.3 Factory Example
This file contains hidden or 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 | |
$factory->define(App\Patient::class, function (Faker\Generator $faker) { | |
$_marital_statuses = [ | |
'Solteiro(a)', | |
'Casado(a)', | |
'Divorciado(a)', | |
'Viúvo(a)', | |
'Separado(a)', | |
'Companheiro(a)' | |
]; | |
$_colors = [ | |
'Negro', | |
'Branco', | |
'Mulato', | |
'Oriental' | |
]; | |
return [ | |
'name' => $faker->name, | |
'gender' => $faker->randomElement($array = array ('m','f')), | |
'born_date' => $faker->date(), | |
'nationality' => 'brasileiro', | |
'color' => $faker->randomElement($_colors), | |
'marital_status' => $faker->randomElement($_marital_statuses), | |
'occupation' => $faker->jobTitle(), | |
'zipcode' => $faker->postcode, | |
'address' => $faker->streetAddress, | |
'burgh' => $faker->streetName, | |
'city_id' => $faker->numberBetween(23, 187), | |
'state_id' => 2, | |
'email' => $faker->unique()->safeEmail, | |
'phone' => $faker->tollFreePhoneNumber, | |
'cellphone' => $faker->tollFreePhoneNumber, | |
'workphone' => $faker->tollFreePhoneNumber | |
]; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment