Added date casting and fillable to models

Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
snipe 2022-10-05 16:57:59 -07:00
parent d23e178c62
commit cf62761d18

View file

@ -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',
];
/**