Skip to content

A free open source IT asset/license management system

Tightened up and removed some validation that wasn’t needed

snipe9c79fc19cb6e
diff --git a/app/Models/Asset.php b/app/Models/Asset.php
index e3e2e96b0c..3c1bc9beca 100644
--- a/app/Models/Asset.php
+++ b/app/Models/Asset.php
@@ -84,11 +84,11 @@ class Asset extends Depreciable
protected $casts = [
- 'purchase_date' => 'datetime',
+ 'purchase_date' => 'date',
'last_checkout' => 'datetime',
- 'expected_checkin' => 'datetime',
+ 'expected_checkin' => 'date',
'last_audit_date' => 'datetime',
- 'next_audit_date' => 'datetime',
+ 'next_audit_date' => 'date',
'model_id' => 'integer',
'status_id' => 'integer',
'company_id' => 'integer',
@@ -105,17 +105,14 @@ class Asset extends Depreciable
'company_id' => 'integer|nullable',
'warranty_months' => 'numeric|nullable|digits_between:0,240',
'physical' => 'numeric|max:1|nullable',
- 'checkout_date' => 'date_format:Y-m-d|max:10|min:10|nullable',
- 'checkin_date' => 'date_format:Y-m-d|max:10|min:10|nullable',
+ 'last_checkout' => 'date|date_format:Y-m-d H:i:s|nullable',
+ 'expected_checkin' => 'date|date_format:Y-m-d|nullable',
'location_id' => 'exists:locations,id|nullable',
'rtd_location_id' => 'exists:locations,id|nullable',
'asset_tag' => 'required|min:1|max:255|unique_undeleted',
- 'status' => 'integer',
- 'purchase_date' => 'date_format:Y-m-d|nullable',
+ 'purchase_date' => 'date|date_format:Y-m-d|nullable',
'serial' => 'unique_serial|nullable',
'purchase_cost' => 'numeric|nullable|gte:0',
- 'next_audit_date' => 'date_format:Y-m-d|nullable',
- 'last_audit_date' => 'date_format:Y-m-d|nullable',
'supplier_id' => 'exists:suppliers,id|nullable',
];