From 03874a54817ded4e7331fb48e0d58dd53075181c Mon Sep 17 00:00:00 2001 From: snipe Date: Thu, 12 Jan 2017 03:47:45 -0800 Subject: [PATCH] Validate asset model and status on the model level --- app/Models/Asset.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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',