@extends('layouts.app') @section('title', 'Audit Logs') @push('styles') @endpush @section('content')

Audit Logs

PRD §10.2 — Immutable activity trail for all critical operations

Read-Only
{{-- Filter Panel --}}
{{-- User --}}
{{-- Model Type --}}
{{-- Action --}}
{{-- Date Range --}}
{{-- Search + Buttons --}}
{{-- Keyword search row --}}
Showing {{ $logs->firstItem() ?? 0 }}–{{ $logs->lastItem() ?? 0 }} of {{ number_format($logs->total()) }} records
{{-- Audit Log Table --}}
@if($logs->isEmpty())
No Audit Records Found

Adjust your filters or check back later.

@else
@foreach($logs as $log) {{-- Detail Modal --}} @endforeach
# Timestamp User Action Entity ID Changes Summary
{{ $log->id }}
{{ $log->created_at->format('d M Y') }}
{{ $log->created_at->format('h:i:s A') }}
@if($log->user) {{ $log->user->name }} @else System @endif {{ ucfirst(str_replace('_', ' ', $log->action)) }} {{ class_basename($log->auditable_type) }} {{ $log->auditable_id }} @if($log->action === 'created' && $log->new_values) {{ Str::limit(implode(', ', array_keys($log->new_values)), 80) }} @elseif($log->action === 'updated' && $log->new_values) @foreach(array_slice($log->new_values, 0, 3) as $field => $value) {{ $field }} → {{ Str::limit(is_array($value) ? json_encode($value) : (string) $value, 20) }}{{ !$loop->last ? ', ' : '' }} @endforeach @if(count($log->new_values) > 3) +{{ count($log->new_values) - 3 }} more @endif @elseif(in_array($log->action, ['deleted', 'soft_deleted'])) Record removed @elseif($log->action === 'restored') Record restored @else @endif
@endif
{{-- Pagination --}} @if($logs->hasPages()) @endif
@endsection