mirror of
https://github.com/snipe/snipe-it.git
synced 2025-01-12 06:17:28 -08:00
Updated validation to allow nullable integrers #3064
This commit is contained in:
parent
e67b3e474f
commit
2f03c5ddb0
|
@ -31,7 +31,7 @@ class AssetMaintenance extends Model implements ICompanyableChild
|
|||
'start_date' => 'required|date_format:Y-m-d',
|
||||
'completion_date' => 'date_format:Y-m-d',
|
||||
'notes' => 'string',
|
||||
'cost' => 'numeric'
|
||||
'cost' => 'numeric|nullable'
|
||||
];
|
||||
|
||||
public function getCompanyableParents()
|
||||
|
|
|
@ -35,9 +35,9 @@ class Component extends SnipeModel
|
|||
'name' => 'required|min:3|max:255',
|
||||
'qty' => 'required|integer|min:1',
|
||||
'category_id' => 'required|integer',
|
||||
'company_id' => 'integer',
|
||||
'purchase_date' => 'date',
|
||||
'purchase_cost' => 'numeric',
|
||||
'company_id' => 'integer|nullable',
|
||||
'purchase_date' => 'date|nullable',
|
||||
'purchase_cost' => 'numeric|nullable',
|
||||
);
|
||||
|
||||
/**
|
||||
|
|
|
@ -30,9 +30,9 @@ class Consumable extends SnipeModel
|
|||
'name' => 'required|min:3|max:255',
|
||||
'qty' => 'required|integer|min:0',
|
||||
'category_id' => 'required|integer',
|
||||
'company_id' => 'integer',
|
||||
'company_id' => 'integer|nullable',
|
||||
'min_amt' => 'integer|min:1',
|
||||
'purchase_cost' => 'numeric',
|
||||
'purchase_cost' => 'numeric|nullable',
|
||||
);
|
||||
|
||||
/**
|
||||
|
|
|
@ -15,13 +15,13 @@ class Location extends SnipeModel
|
|||
protected $dates = ['deleted_at'];
|
||||
protected $table = 'locations';
|
||||
protected $rules = array(
|
||||
'name' => 'required|min:3|max:255|unique_undeleted',
|
||||
'city' => 'min:3|max:255',
|
||||
'state' => 'min:0|max:2',
|
||||
'country' => 'min:2|max:2',
|
||||
'address' => 'min:5|max:80',
|
||||
'address2' => 'min:2|max:80',
|
||||
'zip' => 'min:3|max:10',
|
||||
'name' => 'required|min:2|max:255|unique_undeleted',
|
||||
'city' => 'min:3|max:255|nullable',
|
||||
'state' => 'max:2|nullable',
|
||||
'country' => 'min:2|max:2|nullable',
|
||||
'address' => 'max:80|nullable',
|
||||
'address2' => 'max:80|nullable',
|
||||
'zip' => 'min:3|max:10|nullable',
|
||||
);
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue