Add some audit things.

This commit is contained in:
James Cole
2024-01-01 10:06:44 +01:00
parent 3ad155882a
commit 88bf76fa27
2 changed files with 4 additions and 0 deletions

View File

@@ -118,6 +118,8 @@ class CreateController extends Controller
$request->session()->flash('success', (string)trans('firefly.stored_new_budget', ['name' => $budget->name]));
app('preferences')->mark();
Log::channel('audit')->info('Stored new budget.', $data);
// store attachment(s):
/** @var null|array $files */
$files = $request->hasFile('attachments') ? $request->file('attachments') : null;

View File

@@ -126,6 +126,8 @@ class EditController extends Controller
$this->repository->cleanupBudgets();
app('preferences')->mark();
Log::channel('audit')->info(sprintf('Updated budget #%d.', $budget->id), $data);
$redirect = redirect($this->getPreviousUrl('budgets.edit.url'));
// store new attachment(s):