Start recording ip, user agent, and source

This commit is contained in:
Marcus Moore 2025-02-18 16:04:53 -08:00
parent 79d1147f20
commit 1995e1399e
No known key found for this signature in database

View file

@ -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'])