mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-25 05:34:06 -08:00
Merge pull request #12765 from spencerrlongg/chore/sc-20230
Change protected $dates to casts
This commit is contained in:
commit
ead5293ee0
|
@ -70,19 +70,6 @@ class Asset extends Depreciable
|
||||||
*/
|
*/
|
||||||
protected $injectUniqueIdentifier = true;
|
protected $injectUniqueIdentifier = true;
|
||||||
|
|
||||||
// We set these as protected dates so that they will be easily accessible via Carbon
|
|
||||||
protected $dates = [
|
|
||||||
'created_at',
|
|
||||||
'updated_at',
|
|
||||||
'deleted_at',
|
|
||||||
'purchase_date',
|
|
||||||
'last_checkout',
|
|
||||||
'expected_checkin',
|
|
||||||
'last_audit_date',
|
|
||||||
'next_audit_date'
|
|
||||||
];
|
|
||||||
|
|
||||||
|
|
||||||
protected $casts = [
|
protected $casts = [
|
||||||
'purchase_date' => 'date',
|
'purchase_date' => 'date',
|
||||||
'last_checkout' => 'datetime',
|
'last_checkout' => 'datetime',
|
||||||
|
@ -96,6 +83,9 @@ class Asset extends Depreciable
|
||||||
'rtd_company_id' => 'integer',
|
'rtd_company_id' => 'integer',
|
||||||
'supplier_id' => 'integer',
|
'supplier_id' => 'integer',
|
||||||
'byod' => 'boolean',
|
'byod' => 'boolean',
|
||||||
|
'created_at' => 'datetime',
|
||||||
|
'updated_at' => 'datetime',
|
||||||
|
'deleted_at' => 'datetime',
|
||||||
];
|
];
|
||||||
|
|
||||||
protected $rules = [
|
protected $rules = [
|
||||||
|
|
|
@ -73,18 +73,13 @@ class User extends SnipeModel implements AuthenticatableContract, AuthorizableCo
|
||||||
'location_id' => 'integer',
|
'location_id' => 'integer',
|
||||||
'company_id' => 'integer',
|
'company_id' => 'integer',
|
||||||
'vip' => 'boolean',
|
'vip' => 'boolean',
|
||||||
|
'created_at' => 'datetime',
|
||||||
|
'updated_at' => 'datetime',
|
||||||
|
'deleted_at' => 'datetime',
|
||||||
|
'start_date' => 'datetime:Y-m-d',
|
||||||
|
'end_date' => 'datetime:Y-m-d',
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
||||||
protected $dates = [
|
|
||||||
'created_at',
|
|
||||||
'updated_at',
|
|
||||||
'deleted_at',
|
|
||||||
'start_date' => 'date_format:Y-m-d',
|
|
||||||
'end_date' => 'date_format:Y-m-d',
|
|
||||||
];
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Model validation rules
|
* Model validation rules
|
||||||
*
|
*
|
||||||
|
|
Loading…
Reference in a new issue