From cf62761d18725ff3e2c7fe0d3c82f477ad437354 Mon Sep 17 00:00:00 2001 From: snipe Date: Wed, 5 Oct 2022 16:57:59 -0700 Subject: [PATCH] Added date casting and fillable to models Signed-off-by: snipe --- app/Models/User.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/app/Models/User.php b/app/Models/User.php index b33997e860..09e3509124 100755 --- a/app/Models/User.php +++ b/app/Models/User.php @@ -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', ]; /**