fixed tests

This commit is contained in:
denisdulici
2019-11-18 10:54:26 +03:00
parent 63ab57730d
commit 2cdc431f8c
17 changed files with 123 additions and 154 deletions

View File

@ -0,0 +1,21 @@
<?php
use App\Models\Auth\User;
use App\Models\Common\Item;
use Faker\Generator as Faker;
$factory->define(Item::class, function (Faker $faker) {
$user = User::first();
$company = $user->companies()->first();
return [
'company_id' => $company->id,
'name' => $faker->text(15),
'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(),
'tax_id' => '',
'enabled' => $faker->boolean ? 1 : 0
];
});