A free open source IT asset/license management system
Merge pull request #15907 from uberbrady/protect_assigned_to_assigned_type_rebased
snipea67b320cae53
diff --cc app/Models/Asset.phpindex ac4fecac34,862b994362..757024fe54--- a/app/Models/Asset.php+++ b/app/Models/Asset.php@@@ -119,10 -119,11 +119,11 @@@ class Asset extends Depreciabl'byod' => ['nullable', 'boolean'],'order_number' => ['nullable', 'string', 'max:191'],'notes' => ['nullable', 'string', 'max:65535'],- 'assigned_to' => ['nullable', 'integer'],+ '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'],+ 'assigned_location' => ['nullable', 'exists:locations,id,deleted_at,NULL', 'fmcs_location'],'assigned_asset' => ['nullable', 'exists:assets,id,deleted_at,NULL']];