Skip to content

A free open source IT asset/license management system

Allow null for logCheckin $action_date

snipe26c0cf5d3303
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');