diff --git a/app/Http/Controllers/Assets/AssetCheckinController.php b/app/Http/Controllers/Assets/AssetCheckinController.php index e1a30b30cc..3ebd777865 100644 --- a/app/Http/Controllers/Assets/AssetCheckinController.php +++ b/app/Http/Controllers/Assets/AssetCheckinController.php @@ -106,9 +106,9 @@ class AssetCheckinController extends Controller $asset->location_id = e($request->get('location_id')); } - $checkin_at = date('Y-m-d'); - if ($request->filled('checkin_at')) { - $checkin_at = $request->input('checkin_at'); + $checkin_at = date('Y-m-d H:i:s'); + if (($request->filled('checkin_at')) && ($request->get('checkin_at') != date('Y-m-d'))) { + $checkin_at = $request->get('checkin_at'); } if(!empty($asset->licenseseats->all())){ diff --git a/app/Models/Loggable.php b/app/Models/Loggable.php index 3609298ac7..33e66d44e0 100644 --- a/app/Models/Loggable.php +++ b/app/Models/Loggable.php @@ -115,6 +115,10 @@ trait Loggable $log->note = $note; $log->action_date = $action_date; + if (! $log->action_date) { + $log->action_date = date('Y-m-d H:i:s'); + } + if (Auth::user()) { $log->user_id = Auth::user()->id; }