added random to tests

This commit is contained in:
denisdulici
2020-01-07 09:29:45 +03:00
parent 44fd928fa1
commit 40a5327f07
6 changed files with 26 additions and 22 deletions

View File

@ -16,7 +16,7 @@ $factory->define(Item::class, function (Faker $faker) use ($company) {
'description' => $faker->text(100),
'purchase_price' => $faker->randomFloat(2, 10, 20),
'sale_price' => $faker->randomFloat(2, 10, 20),
'category_id' => $company->categories()->type('item')->pluck('id')->first(),
'category_id' => $company->categories()->type('item')->get()->random(1)->pluck('id')->first(),
'tax_id' => null,
'enabled' => $faker->boolean ? 1 : 0,
];