Slide 8
Slide 8 text
Model Factory + Faker
$factory->define(App\Task::class, function (Faker $faker) {
return [
'subject' => $faker->text(),
'status' => 'open',
‘priority' => 'normal',
];
});
$factory->state(App\Task::class, 'doing', [
'status' => 'doing',
]);
$factory->state(App\Task::class, ‘high', [
'priority' => 'high',
]);
$task = factory(Task::class)->states([‘doing’,’high'])->make();