From b9e821c0e65e0745064b42aa6cccf9627c5df3e6 Mon Sep 17 00:00:00 2001 From: snipe Date: Mon, 11 May 2020 18:07:14 -0700 Subject: [PATCH] Small fix for Group Functional Tests Signed-off-by: snipe --- app/Http/Requests/AssetRequest.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/app/Http/Requests/AssetRequest.php b/app/Http/Requests/AssetRequest.php index 72c3a89ccb..082320e6ba 100644 --- a/app/Http/Requests/AssetRequest.php +++ b/app/Http/Requests/AssetRequest.php @@ -28,6 +28,7 @@ class AssetRequest extends Request public function rules() { $rules = [ + 'asset_tag' => 'required|min:1|max:255|unique_undeleted', 'name' => 'max:255|nullable', 'model_id' => 'required|integer|exists:models,id', 'status_id' => 'required|integer|exists:status_labels,id', @@ -45,9 +46,7 @@ class AssetRequest extends Request ]; $settings = \App\Models\Setting::getSettings(); - - $rules['asset_tag'] = ($settings->auto_increment_assets == '1') ? 'max:255' : 'required'; - + if ($this->request->get('model_id') != '') { $model = AssetModel::find($this->request->get('model_id'));