Skip to content

A free open source IT asset/license management system

Added supplier to components and consumables factories for seeding

snipee7c6771e73ff
diff --git a/database/factories/ComponentFactory.php b/database/factories/ComponentFactory.php
index 6db9ef24fa..caac70078f 100644
--- a/database/factories/ComponentFactory.php
+++ b/database/factories/ComponentFactory.php
@@ -7,6 +7,7 @@ use App\Models\Company;
use App\Models\Component;
use App\Models\Location;
use Illuminate\Database\Eloquent\Factories\Factory;
+use App\Models\Supplier;
class ComponentFactory extends Factory
{
@@ -35,6 +36,7 @@ class ComponentFactory extends Factory
'purchase_cost' => $this->faker->randomFloat(2),
'min_amt' => $this->faker->numberBetween($min = 1, $max = 2),
'company_id' => Company::factory(),
+ 'supplier_id' => Supplier::factory(),
];
}
diff --git a/database/factories/ConsumableFactory.php b/database/factories/ConsumableFactory.php
index 8dd56229e0..5444999711 100644
--- a/database/factories/ConsumableFactory.php
+++ b/database/factories/ConsumableFactory.php
@@ -8,6 +8,7 @@ use App\Models\Consumable;
use App\Models\Manufacturer;
use App\Models\User;
use Illuminate\Database\Eloquent\Factories\Factory;
+use App\Models\Supplier;
class ConsumableFactory extends Factory
{
@@ -36,6 +37,7 @@ class ConsumableFactory extends Factory
'qty' => $this->faker->numberBetween(5, 10),
'min_amt' => $this->faker->numberBetween($min = 1, $max = 2),
'company_id' => Company::factory(),
+ 'supplier_id' => Supplier::factory(),
];
}