//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),
]);
}
random_int(0, 12300)
Str::random(20)
$faker->word
$faker->sentence
$faker->paragraph
$faker->randomFloat(2, 0, 10000)
$faker->image('public/storage/images',640,480, null, false),
$faker->text(200)
$faker->numberBetween(10, 500)
$faker->unique()->numberBetween(100, 500)
$faker->userName,
$faker -> sentence(4,true),
<img src="/storage/images/{{$product->image}}">
php artisan make:factory PostFactory --model=Post
$faker = Factory::create();
//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