mirror of
https://github.com/snipe/snipe-it.git
synced 2025-01-11 13:57:41 -08:00
Updated factories
Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
parent
16d65631aa
commit
24ad74f136
|
@ -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…
Reference in a new issue