Fábrica de Laravel
php artisan tinkerProduct::factory()->count(500)->create()
Average Albatross
php artisan tinkerProduct::factory()->count(500)->create()
factory(App\User::class, 30)->create()->each(function($user) {
$entity = factory(App\Entity::class)->make();
$address = factory(App\Address::class)->create([
'entity_id' => $entity
]);
$user->entities()->save($entity);
});
$users = User::factory()->count(3)->make();
php artisan make:factory UserFactory
php artisan make:model ModelName -a
// -a stands for all (Model, Controller, Factory and Migration)
// Note: The above command will work successfully in Laravel 5.5 or > versions
//Creates models without storing them in DB
$users = User::factory()->count(3)->make();