mirror of
https://github.com/snipe/snipe-it.git
synced 2024-11-09 23:24:06 -08:00
Added date casting and fillable to models
Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
parent
d23e178c62
commit
cf62761d18
|
@ -59,6 +59,8 @@ class User extends SnipeModel implements AuthenticatableContract, AuthorizableCo
|
|||
'username',
|
||||
'zip',
|
||||
'remote',
|
||||
'start_date',
|
||||
'end_date',
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
|
@ -68,6 +70,16 @@ class User extends SnipeModel implements AuthenticatableContract, AuthorizableCo
|
|||
'company_id' => 'integer',
|
||||
];
|
||||
|
||||
|
||||
protected $dates = [
|
||||
'created_at',
|
||||
'updated_at',
|
||||
'deleted_at',
|
||||
'start_date',
|
||||
'end_date',
|
||||
];
|
||||
|
||||
|
||||
/**
|
||||
* Model validation rules
|
||||
*
|
||||
|
@ -83,6 +95,8 @@ class User extends SnipeModel implements AuthenticatableContract, AuthorizableCo
|
|||
'website' => 'url|nullable|max:191',
|
||||
'manager_id' => 'nullable|exists:users,id|cant_manage_self',
|
||||
'location_id' => 'exists:locations,id|nullable',
|
||||
'start_date' => 'nullable|date',
|
||||
'end_date' => 'nullable|date|after_or_equal:start_date',
|
||||
];
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue