@extends('backend.layouts.app') @section('title', \App\Http\Helpers\MenuHelper::getPageTitle()) @section('content') @include('backend.module._index-reset-button')

All Audit Records

{{ $auditEnabled ? 'Active' : 'Inactive' }}

{{ number_format($activities->total()) }} records · Automatically record important changes and authentication activity.

@csrf
@unless ($auditEnabled)

Audit logging is inactive

New changes and login activity are not being recorded. Existing records remain available below.

@endunless
@foreach (['#', 'Date & Time', 'Performed By', 'Action', 'Module', 'Affected Record', 'Changes'] as $heading) @endforeach @forelse ($activities as $activity) @php $eventClass = match ($activity->event) { 'created', 'login' => 'bg-success-50 text-success-600 dark:bg-success-500/15 dark:text-success-400', 'updated' => 'bg-warning-50 text-warning-600 dark:bg-warning-500/15 dark:text-orange-400', 'deleted', 'login_failed' => 'bg-error-50 text-error-600 dark:bg-error-500/15 dark:text-error-400', default => 'bg-blue-light-50 text-blue-light-600 dark:bg-blue-light-500/15 dark:text-blue-light-400', }; @endphp @empty @endforelse
{{ $heading }}
{{ ($activities->currentPage() - 1) * $activities->perPage() + $loop->iteration }} {{ $activity->created_at?->format('h:i A') ?? '-' }} {{ $activity->created_at?->format('d-m-Y') ?? '-' }} {{ ($activity->actor_display_name ?? $activity->actor_name) ?: 'System' }} {{ str_replace('_', ' ', ucfirst($activity->event)) }} {{ $activity->module }} @if ($activity->subject_label) @if ($activity->subject_type === 'BackendUser') Username @endif {{ $activity->subject_label }} @if ($activity->subject_id) Record ID: {{ $activity->subject_id }} @endif @else Not applicable @endif @if ((is_array($activity->changes) && count($activity->changes)) || $activity->ip_address || $activity->user_agent) @else - @endif
No audit records found.
{{ $activities->links('vendor.pagination.custom') }}
@foreach ($activities as $activity) @if ((is_array($activity->changes) && count($activity->changes)) || $activity->ip_address || $activity->user_agent)

Changes

{{ $activity->subject_label ?: $activity->module }}

@if (is_array($activity->changes) && count($activity->changes))

Changed fields

@foreach (['Field', 'Before', 'After'] as $heading) @endforeach @foreach ($activity->changes as $field => $change) @endforeach
{{ $heading }}
{{ \Illuminate\Support\Str::headline($field) }} {{ is_array($change['old'] ?? null) ? json_encode($change['old'], JSON_UNESCAPED_UNICODE) : ($change['old'] ?? '—') }} {{ is_array($change['new'] ?? null) ? json_encode($change['new'], JSON_UNESCAPED_UNICODE) : ($change['new'] ?? '—') }}
@endif

Request information

Field Value
IP address {{ $activity->ip_address ?: 'Not recorded' }}
User agent {{ $activity->user_agent ?: 'Not recorded' }}
@endif @endforeach @endsection