mirror of
https://github.com/snipe/snipe-it.git
synced 2025-03-05 20:52:15 -08:00
Inline two relationships in asset maintenance factory
This commit is contained in:
parent
1ff094dd47
commit
72a61783a3
|
@ -5,6 +5,7 @@ namespace Database\Factories;
|
||||||
use App\Models\Asset;
|
use App\Models\Asset;
|
||||||
use App\Models\AssetModel;
|
use App\Models\AssetModel;
|
||||||
use App\Models\Category;
|
use App\Models\Category;
|
||||||
|
use App\Models\Supplier;
|
||||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -33,12 +34,8 @@ class AssetMaintenanceFactory extends Factory
|
||||||
public function definition()
|
public function definition()
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'asset_id' => function () {
|
'asset_id' => Asset::factory(),
|
||||||
return \App\Models\Asset::factory()->create()->id;
|
'supplier_id' => Supplier::factory(),
|
||||||
},
|
|
||||||
'supplier_id' => function () {
|
|
||||||
return \App\Models\Supplier::factory()->create()->id;
|
|
||||||
},
|
|
||||||
'asset_maintenance_type' => $this->faker->randomElement(['maintenance', 'repair', 'upgrade']),
|
'asset_maintenance_type' => $this->faker->randomElement(['maintenance', 'repair', 'upgrade']),
|
||||||
'title' => $this->faker->sentence,
|
'title' => $this->faker->sentence,
|
||||||
'start_date' => $this->faker->date(),
|
'start_date' => $this->faker->date(),
|
||||||
|
|
Loading…
Reference in a new issue