//Usando Faker/Factory pra gerar valores fake
use FakerFactory as Faker;
$faker = Faker::create();
foreach(range(1, 30) as $index) {
Employee::create([
'email' => $faker->email(),
'name' => $faker->sentence(5),
'description' => $faker->paragraph(6),
]);
}
php artisan make:factory PostFactory --model=Post
//For documentation, on tinker, run 'doc FakerFactory::create'
//Using Faker/Factory to generate fake values
$faker = FakerFactory::create();
$faker->email();
$faker->sentence(5);
$faker->paragraph(6);
$faker->text();
$faker->name();
$faker->sentence();
return [
...
'avatar' => $this->faker->imageUrl(40,40),
'status' => $this->faker->randomElement(['active','inactive','deleted']),
'country' => $this->faker->country,
];
(FakerFactory::create())->name();
php artisan make:factory PostFactory