Make sure the category and manufacturer ids exist

This commit is contained in:
snipe 2017-01-13 07:14:32 -08:00
parent c7e1b426e7
commit fbbf5e77b4

View file

@ -26,8 +26,8 @@ class AssetModel extends SnipeModel
protected $rules = array(
'name' => 'required|min:1|max:255',
'model_number' => 'min:1|max:255',
'category_id' => 'required|integer',
'manufacturer_id' => 'required|integer',
'category_id' => 'required|integer|exists:categories,id',
'manufacturer_id' => 'required|integer|exists:manufacturers,id',
'eol' => 'integer:min:0|max:24|nullable',
);