mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-25 05:34:06 -08:00
Use more verbose annotation for Auth::user if/else
This commit is contained in:
parent
134e8e6fb9
commit
29f3a5c48f
|
@ -41,8 +41,9 @@ trait Loggable
|
||||||
$settings = Setting::getSettings();
|
$settings = Setting::getSettings();
|
||||||
$log = new Actionlog;
|
$log = new Actionlog;
|
||||||
$log = $this->determineLogItemType($log);
|
$log = $this->determineLogItemType($log);
|
||||||
if(Auth::user())
|
if (Auth::user()) {
|
||||||
$log->user_id = Auth::user()->id;
|
$log->user_id = Auth::user()->id;
|
||||||
|
}
|
||||||
|
|
||||||
if (!isset($target)) {
|
if (!isset($target)) {
|
||||||
throw new \Exception('All checkout logs require a target.');
|
throw new \Exception('All checkout logs require a target.');
|
||||||
|
@ -144,8 +145,10 @@ trait Loggable
|
||||||
|
|
||||||
$log->location_id = null;
|
$log->location_id = null;
|
||||||
$log->note = $note;
|
$log->note = $note;
|
||||||
if(Auth::user())
|
|
||||||
|
if (Auth::user()) {
|
||||||
$log->user_id = Auth::user()->id;
|
$log->user_id = Auth::user()->id;
|
||||||
|
}
|
||||||
|
|
||||||
$log->logaction('checkin from');
|
$log->logaction('checkin from');
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue