27eca4f041
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
22 lines
580 B
PHP
22 lines
580 B
PHP
<?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);
|
|
}
|
|
}
|