Skip to content

A free open source IT asset/license management system

Require assigned_x to be integer on asset model

Marcus Moore02fa7daa1d9e
diff --git a/app/Models/Asset.php b/app/Models/Asset.php
index 29231b22c8..2cb14308c6 100644
--- a/app/Models/Asset.php
+++ b/app/Models/Asset.php
@@ -122,9 +122,9 @@ class Asset extends Depreciable
'assigned_to' => ['nullable', 'integer', 'required_with:assigned_type'],
'assigned_type' => ['nullable', 'required_with:assigned_to', 'in:'.User::class.",".Location::class.",".Asset::class],
'requestable' => ['nullable', 'boolean'],
- 'assigned_user' => ['nullable', 'exists:users,id,deleted_at,NULL'],
- 'assigned_location' => ['nullable', 'exists:locations,id,deleted_at,NULL', 'fmcs_location'],
- 'assigned_asset' => ['nullable', 'exists:assets,id,deleted_at,NULL']
+ 'assigned_user' => ['integer', 'nullable', 'exists:users,id,deleted_at,NULL'],
+ 'assigned_location' => ['integer', 'nullable', 'exists:locations,id,deleted_at,NULL', 'fmcs_location'],
+ 'assigned_asset' => ['integer', 'nullable', 'exists:assets,id,deleted_at,NULL']
];