feat: add activity log admin page and nav links
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user