Total Aktivitas
@extends('layouts.admin') @section('title', 'Audit Log | Super Admin') @section('page_title', 'Audit Log') @push('styles') @endpush @section('content') @php $logCollection = $activityLogs->getCollection(); $totalActivities = method_exists($activityLogs, 'total') ? (int) $activityLogs->total() : (int) $activityLogs->count(); $todayActivities = $logCollection->filter(function ($log) { return $log->created_at && \Illuminate\Support\Carbon::parse($log->created_at)->isToday(); })->count(); $activeUsersInLogs = $logCollection->pluck('user_id')->filter()->unique()->count(); $actionGroups = $logCollection->countBy(function ($log) { return strtolower((string) $log->action); }); $topAction = $actionGroups->sortDesc()->keys()->first(); $targetGroups = $logCollection->countBy(function ($log) { return strtolower((string) $log->target_type); }); $topTargetType = $targetGroups->sortDesc()->keys()->first(); $targetTypeOptions = $logCollection ->pluck('target_type') ->filter() ->map(fn($value) => strtolower((string) $value)) ->unique() ->values(); $actionBadge = function (?string $action): string { $normalized = strtolower((string) $action); return match (true) { str_contains($normalized, 'create'), str_contains($normalized, 'store') => 'is-success', str_contains($normalized, 'update'), str_contains($normalized, 'edit') => 'is-info', str_contains($normalized, 'delete'), str_contains($normalized, 'destroy') => 'is-danger', str_contains($normalized, 'verify'), str_contains($normalized, 'approve') => 'is-verify', str_contains($normalized, 'reject'), str_contains($normalized, 'cancel') => 'is-warning', str_contains($normalized, 'login'), str_contains($normalized, 'logout'), str_contains($normalized, 'system') => 'is-muted', default => 'is-muted', }; }; $targetBadge = function (?string $targetType): string { $normalized = strtolower((string) $targetType); return match ($normalized) { 'booking' => 'is-booking', 'payment' => 'is-payment', 'vehicle' => 'is-vehicle', 'rental', 'rental_company' => 'is-rental', 'promo' => 'is-promo', 'review' => 'is-review', 'user' => 'is-user', default => 'is-system', }; }; $prettyLabel = function (?string $raw): string { $normalized = str_replace(['.', '_'], [' / ', ' '], strtolower((string) $raw)); return ucwords(trim($normalized) === '' ? '-' : trim($normalized)); }; @endphp
Pantau aktivitas penting sistem dan perubahan data yang dilakukan oleh pengguna platform.
Total Aktivitas
Aktivitas Hari Ini
Total User Aktif di Log
Action / Target Terbanyak
Log terbaru ditampilkan di atas untuk membantu investigasi aktivitas sistem.
| No | Waktu | User | Action | Target Type | Target ID | Deskripsi | Meta / Detail Singkat | Aksi |
|---|---|---|---|---|---|---|---|---|
| {{ ($activityLogs->firstItem() ?? 1) + $index }} |
{{ $createdAt?->format('d M Y') ?? '-' }}
{{ $createdAt?->format('H:i:s') ?? '-' }} |
@if ($log->user)
{{ $log->user->name }}
{{ $log->user->email }} @else System Unknown User @endif |
{{ $prettyLabel($log->action) }} | {{ $prettyLabel($log->target_type) }} | {{ $log->target_id ?? '-' }} |
{{ $log->description ?? '-' }}
|
{{ $metaSummary }}
|
@if (Route::has('super-admin.activity-logs.show')) Detail @else Detail @endif |
Aktivitas sistem akan muncul di halaman ini saat pengguna mulai melakukan aksi pada platform.