@extends('hr::layouts.app') @section('title', 'Audit Log Statistics') @section('content')

Audit Log Statistics

{{ number_format($stats['total_logs']) }}

Total Logs ({{ $dateRange }} days)

{{ $stats['events']->where('event', 'created')->first()->count ?? 0 }}

Created Records

{{ $stats['events']->where('event', 'updated')->first()->count ?? 0 }}

Updated Records

{{ $stats['events']->where('event', 'deleted')->first()->count ?? 0 }}

Deleted Records

Events Distribution
Models Activity
Most Active Users
@forelse($stats['users'] as $userStat) @empty @endforelse
User Email Actions
@if($userStat->user) {{ $userStat->user->name }} @else Unknown @endif @if($userStat->user) {{ $userStat->user->email }} @else - @endif {{ $userStat->count }}
No user activity found
Daily Activity
Events Summary
@foreach($stats['events'] as $event) @endforeach
Event Count Percentage
{{ ucfirst($event->event) }} {{ number_format($event->count) }} @php $percentage = $stats['total_logs'] > 0 ? round(($event->count / $stats['total_logs']) * 100, 1) : 0; @endphp
{{ $percentage }}%
Models Summary
@foreach($stats['models'] as $model) @endforeach
Model Count Percentage
{{ class_basename($model->auditable_type) }} {{ number_format($model->count) }} @php $percentage = $stats['total_logs'] > 0 ? round(($model->count / $stats['total_logs']) * 100, 1) : 0; @endphp
{{ $percentage }}%
@push('scripts') @endpush @endsection