mirror of
https://github.com/snipe/snipe-it.git
synced 2024-11-10 07:34:06 -08:00
some changes
This commit is contained in:
parent
8962ced038
commit
f01b205486
|
@ -89,61 +89,61 @@ class Asset extends Depreciable
|
||||||
'deleted_at' => 'datetime',
|
'deleted_at' => 'datetime',
|
||||||
];
|
];
|
||||||
|
|
||||||
//protected $rules = [
|
protected $rules = [
|
||||||
// 'model_id' => 'required|integer|exists:models,id,deleted_at,NULL|not_array',
|
'model_id' => 'required|integer|exists:models,id,deleted_at,NULL|not_array',
|
||||||
// 'status_id' => 'required|integer|exists:status_labels,id',
|
'status_id' => 'required|integer|exists:status_labels,id',
|
||||||
// 'asset_tag' => ['required', 'min:1', 'max:255', 'unique_undeleted:assets,asset_tag', 'not_array', Rule::unique('assets')->ignore($this->id)->withoutTrashed()],
|
'asset_tag' => 'required|min:1|max:255|not_array|unique:assets,asset_tag,asset,id,deleted_at,"NULL"',
|
||||||
// 'name' => 'nullable|max:255',
|
'name' => 'nullable|max:255',
|
||||||
// 'company_id' => 'nullable|integer|exists:companies,id',
|
'company_id' => 'nullable|integer|exists:companies,id',
|
||||||
// 'warranty_months' => 'nullable|numeric|digits_between:0,240',
|
'warranty_months' => 'nullable|numeric|digits_between:0,240',
|
||||||
// 'last_checkout' => 'nullable|date_format:Y-m-d H:i:s',
|
'last_checkout' => 'nullable|date_format:Y-m-d H:i:s',
|
||||||
// 'expected_checkin' => 'nullable|date',
|
'expected_checkin' => 'nullable|date',
|
||||||
// 'location_id' => 'nullable|exists:locations,id',
|
'location_id' => 'nullable|exists:locations,id',
|
||||||
// 'rtd_location_id' => 'nullable|exists:locations,id',
|
'rtd_location_id' => 'nullable|exists:locations,id',
|
||||||
// 'purchase_date' => 'nullable|date|date_format:Y-m-d',
|
'purchase_date' => 'nullable|date|date_format:Y-m-d',
|
||||||
// 'serial' => 'nullable|unique_undeleted:assets,serial',
|
'serial' => 'nullable|unique_undeleted:assets,serial',
|
||||||
// 'purchase_cost' => 'nullable|numeric|gte:0',
|
'purchase_cost' => 'nullable|numeric|gte:0',
|
||||||
// 'supplier_id' => 'nullable|exists:suppliers,id',
|
'supplier_id' => 'nullable|exists:suppliers,id',
|
||||||
// 'asset_eol_date' => 'nullable|date',
|
'asset_eol_date' => 'nullable|date',
|
||||||
// 'eol_explicit' => 'nullable|boolean',
|
'eol_explicit' => 'nullable|boolean',
|
||||||
// 'byod' => 'nullable|boolean',
|
'byod' => 'nullable|boolean',
|
||||||
// 'order_number' => 'nullable|string|max:191',
|
'order_number' => 'nullable|string|max:191',
|
||||||
// 'notes' => 'nullable|string|max:65535',
|
'notes' => 'nullable|string|max:65535',
|
||||||
// 'assigned_to' => 'nullable|integer',
|
'assigned_to' => 'nullable|integer',
|
||||||
// 'requestable' => 'nullable|boolean',
|
'requestable' => 'nullable|boolean',
|
||||||
//];
|
];
|
||||||
|
|
||||||
public function getRulesAttribute()
|
//public function getRulesAttribute()
|
||||||
{
|
//{
|
||||||
return [
|
// return [
|
||||||
'model_id' => 'required|integer|exists:models,id,deleted_at,NULL|not_array',
|
// 'model_id' => 'required|integer|exists:models,id,deleted_at,NULL|not_array',
|
||||||
'status_id' => 'required|integer|exists:status_labels,id',
|
// 'status_id' => 'required|integer|exists:status_labels,id',
|
||||||
'asset_tag' => [
|
// 'asset_tag' => [
|
||||||
'required',
|
// 'required',
|
||||||
'min:1',
|
// 'min:1',
|
||||||
'max:255',
|
// 'max:255',
|
||||||
Rule::unique('assets')->ignore(15)->withoutTrashed()
|
// Rule::unique('assets')->ignore(15)->withoutTrashed()
|
||||||
],
|
// ],
|
||||||
'name' => 'nullable|max:255',
|
// 'name' => 'nullable|max:255',
|
||||||
'company_id' => 'nullable|integer|exists:companies,id',
|
// 'company_id' => 'nullable|integer|exists:companies,id',
|
||||||
'warranty_months' => 'nullable|numeric|digits_between:0,240',
|
// 'warranty_months' => 'nullable|numeric|digits_between:0,240',
|
||||||
'last_checkout' => 'nullable|date_format:Y-m-d H:i:s',
|
// 'last_checkout' => 'nullable|date_format:Y-m-d H:i:s',
|
||||||
'expected_checkin' => 'nullable|date',
|
// 'expected_checkin' => 'nullable|date',
|
||||||
'location_id' => 'nullable|exists:locations,id',
|
// 'location_id' => 'nullable|exists:locations,id',
|
||||||
'rtd_location_id' => 'nullable|exists:locations,id',
|
// 'rtd_location_id' => 'nullable|exists:locations,id',
|
||||||
'purchase_date' => 'nullable|date|date_format:Y-m-d',
|
// 'purchase_date' => 'nullable|date|date_format:Y-m-d',
|
||||||
'serial' => 'nullable|unique_undeleted:assets,serial',
|
// 'serial' => 'nullable|unique_undeleted:assets,serial',
|
||||||
'purchase_cost' => 'nullable|numeric|gte:0',
|
// 'purchase_cost' => 'nullable|numeric|gte:0',
|
||||||
'supplier_id' => 'nullable|exists:suppliers,id',
|
// 'supplier_id' => 'nullable|exists:suppliers,id',
|
||||||
'asset_eol_date' => 'nullable|date',
|
// 'asset_eol_date' => 'nullable|date',
|
||||||
'eol_explicit' => 'nullable|boolean',
|
// 'eol_explicit' => 'nullable|boolean',
|
||||||
'byod' => 'nullable|boolean',
|
// 'byod' => 'nullable|boolean',
|
||||||
'order_number' => 'nullable|string|max:191',
|
// 'order_number' => 'nullable|string|max:191',
|
||||||
'notes' => 'nullable|string|max:65535',
|
// 'notes' => 'nullable|string|max:65535',
|
||||||
'assigned_to' => 'nullable|integer',
|
// 'assigned_to' => 'nullable|integer',
|
||||||
'requestable' => 'nullable|boolean',
|
// 'requestable' => 'nullable|boolean',
|
||||||
];
|
// ];
|
||||||
}
|
//}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The attributes that are mass assignable.
|
* The attributes that are mass assignable.
|
||||||
|
|
Loading…
Reference in a new issue