Updated factories
Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
parent
16d65631aa
commit
24ad74f136
2 changed files with 12 additions and 3 deletions
|
@ -300,11 +300,11 @@ class AssetFactory extends Factory
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public function assignedToLocation()
|
public function assignedToLocation(Location $location = null)
|
||||||
{
|
{
|
||||||
return $this->state(function () {
|
return $this->state(function () use ($location) {
|
||||||
return [
|
return [
|
||||||
'assigned_to' => Location::factory(),
|
'assigned_to' => $location->id ?? Location::factory(),
|
||||||
'assigned_type' => Location::class,
|
'assigned_type' => Location::class,
|
||||||
];
|
];
|
||||||
});
|
});
|
||||||
|
|
|
@ -25,4 +25,13 @@ class LocationFactory extends Factory
|
||||||
'image' => rand(1, 9).'.jpg',
|
'image' => rand(1, 9).'.jpg',
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function deletedLocation()
|
||||||
|
{
|
||||||
|
return $this->state(function () {
|
||||||
|
return [
|
||||||
|
'deleted_at' => $this->faker->dateTime(),
|
||||||
|
];
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue