Files
firefly-iii/app/Support/Logging/AuditProcessor.php

28 lines
528 B
PHP
Raw Normal View History

2019-02-08 07:13:59 +01:00
<?php
declare(strict_types=1);
namespace FireflyIII\Support\Logging;
/**
* Class AuditProcessor
*/
class AuditProcessor
{
/**
* @param array $record
*
* @return array
*/
public function __invoke(array $record): array
{
$record['extra']['path'] = request()->method() . ':' . request()->url();
$record['extra']['IP'] = app('request')->ip();
if (auth()->check()) {
$record['extra']['user'] = auth()->user()->email;
}
return $record;
}
}