Skip to content

Commit

Permalink
Use more verbose annotation for Auth::user if/else
Browse files Browse the repository at this point in the history
  • Loading branch information
snipe committed Aug 14, 2020
1 parent 134e8e6 commit 29f3a5c
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions app/Models/Loggable.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,9 @@ public function logCheckout($note, $target /* What are we checking out to? */)
$settings = Setting::getSettings();
$log = new Actionlog;
$log = $this->determineLogItemType($log);
if(Auth::user())
if (Auth::user()) {
$log->user_id = Auth::user()->id;
}

if (!isset($target)) {
throw new \Exception('All checkout logs require a target.');
Expand Down Expand Up @@ -144,9 +145,11 @@ public function logCheckin($target, $note)

$log->location_id = null;
$log->note = $note;
if(Auth::user())
$log->user_id = Auth::user()->id;

if (Auth::user()) {
$log->user_id = Auth::user()->id;
}

$log->logaction('checkin from');

$params = [
Expand Down

0 comments on commit 29f3a5c

Please sign in to comment.