From 1995e1399e835002310f6998c3c2bf03fa5f3443 Mon Sep 17 00:00:00 2001 From: Marcus Moore Date: Tue, 18 Feb 2025 16:04:53 -0800 Subject: [PATCH] Start recording ip, user agent, and source --- app/Http/Controllers/NotesController.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/Http/Controllers/NotesController.php b/app/Http/Controllers/NotesController.php index 3538e076f3..dd32b17ebc 100644 --- a/app/Http/Controllers/NotesController.php +++ b/app/Http/Controllers/NotesController.php @@ -3,6 +3,7 @@ namespace App\Http\Controllers; use App\Events\NoteAdded; +use App\Models\Actionlog; use App\Models\Asset; use Illuminate\Http\Request; use Illuminate\Support\Facades\Auth; @@ -26,7 +27,12 @@ class NotesController extends Controller // @todo: authorization - event(new NoteAdded($item, Auth::user(), $validated['note'])); + $logaction = new Actionlog(); + $logaction->item_id = $item->id; + $logaction->item_type = get_class($item); + $logaction->note = $validated['note']; + $logaction->created_by = Auth::id(); + $logaction->logaction('note added'); return redirect() ->route('hardware.show', $validated['id'])