mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-24 22:48:18 +00:00
28 lines
528 B
PHP
28 lines
528 B
PHP
![]() |
<?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;
|
||
|
}
|
||
|
}
|