feat: add activity log admin page and nav links

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
GuavaPopper
2026-06-04 14:28:00 +07:00
parent c4eb884495
commit 27eca4f041
7 changed files with 150 additions and 0 deletions
@@ -0,0 +1,21 @@
<?php
namespace App\Http\Controllers;
use App\Models\ActivityLog;
class ActivityLogController extends Controller
{
public function index()
{
$logs = ActivityLog::latest()->limit(200)->get()->map(fn($l) => [
'id' => $l->id,
'user' => $l->user_name ?? 'Sistem',
'action' => $l->action,
'description' => $l->description,
'ip' => $l->ip_address,
'created_at' => $l->created_at?->format('d/m/Y H:i:s'),
]);
return response()->json($logs);
}
}