From 26c0cf5d3303f4146a691fa30c117bfd808c5b97 Mon Sep 17 00:00:00 2001 From: snipe Date: Thu, 14 Mar 2019 01:22:29 -0700 Subject: [PATCH] Allow null for logCheckin $action_date --- app/Models/Loggable.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/Models/Loggable.php b/app/Models/Loggable.php index 412486a3ec..821c5a49ea 100644 --- a/app/Models/Loggable.php +++ b/app/Models/Loggable.php @@ -81,7 +81,7 @@ trait Loggable * @since [v3.4] * @return \App\Models\Actionlog */ - public function logCheckin($target, $note, $action_date) + public function logCheckin($target, $note, $action_date = null) { $log = new Actionlog; $log->target_type = get_class($target); @@ -106,7 +106,12 @@ trait Loggable $log->location_id = null; $log->note = $note; + $log->action_date = $action_date; + + if (!$log->action_date) { + $log->action_date = date('Y-m-d H:i:s'); + } $log->user_id = Auth::user()->id; $log->logaction('checkin from');