From f1a6308002caa865fe1a9b17b91d34fbfdd94a75 Mon Sep 17 00:00:00 2001 From: snipe Date: Fri, 14 Aug 2020 14:43:07 -0700 Subject: [PATCH] Check for Auth::user before trying to log id (for cli) --- app/Models/Loggable.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/Models/Loggable.php b/app/Models/Loggable.php index 71a4e298c1..ea374dd486 100644 --- a/app/Models/Loggable.php +++ b/app/Models/Loggable.php @@ -144,7 +144,9 @@ trait Loggable $log->location_id = null; $log->note = $note; - $log->user_id = Auth::user()->id; + if(Auth::user()) + $log->user_id = Auth::user()->id; + $log->logaction('checkin from'); $params = [