Skip to content

A free open source IT asset/license management system

Validate asset model and status on the model level

snipe03874a54817d
diff --git a/app/Models/Asset.php b/app/Models/Asset.php
index 4f9e778f30..1e78890cb5 100644
--- a/app/Models/Asset.php
+++ b/app/Models/Asset.php
@@ -44,8 +44,8 @@ class Asset extends Depreciable
protected $rules = [
'name' => 'max:255|nullable',
- 'model_id' => 'required|integer',
- 'status_id' => 'required|integer',
+ 'model_id' => 'required|integer|exists:models,id',
+ 'status_id' => 'required|integer|exists:status_labels,id',
'company_id' => 'integer|nullable',
'warranty_months' => 'numeric|nullable',
'physical' => 'numeric|max:1|nullable',