Re-add asset factory states

This commit is contained in:
Marcus Moore 2023-03-21 09:54:55 -07:00
parent d214bd0b06
commit 751abe1438
No known key found for this signature in database

View file

@ -275,6 +275,37 @@ class AssetFactory extends Factory
});
}
public function assignedToUser()
{
return $this->state(function () {
return [
'assigned_to' => User::factory(),
'assigned_type' => User::class,
];
});
}
public function assignedToLocation()
{
return $this->state(function () {
return [
'assigned_to' => Location::factory(),
'assigned_type' => Location::class,
];
});
}
public function assignedToAsset()
{
return $this->state(function () {
return [
'model_id' => 1,
'assigned_to' => Asset::factory(),
'assigned_type' => Asset::class,
];
});
}
public function requiresAcceptance()
{
return $this->state(function () {