@php $actionBadgeClasses = [ 'insert' => 'bg-green-100 text-green-700', 'update' => 'bg-blue-100 text-blue-700', 'delete' => 'bg-red-100 text-red-700', ]; $formatValue = function ($value): string { if ($value === null) { return 'null'; } if (is_bool($value)) { return $value ? 'true' : 'false'; } if (is_array($value)) { return json_encode($value, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT) ?: '[]'; } return (string) $value; }; $labelize = function (string $key): string { return \Illuminate\Support\Str::of($key)->replace('_', ' ')->title()->toString(); }; @endphp

Audit Logs

List of all insert, update, and delete actions performed from the admin panel.

Reset
@forelse ($auditLogs as $auditLog) @empty @endforelse
When Action Module Table Performed By Record Details
{{ \App\Support\CalendarDate::format($auditLog->action_at, 'Y-m-d H:i:s', '-') }} {{ strtoupper($auditLog->action) }} {{ $auditLog->module ?: 'Unknown' }} {{ $auditLog->table_name }}

{{ $auditLog->admin_user_name ?: 'System/Unknown' }}

{{ $auditLog->admin_user_email ?: '-' }}

UUID: {{ $auditLog->record_uuid ?: '-' }}

Audit Log Detail

{{ strtoupper($auditLog->action) }} Module: {{ $auditLog->module ?: 'Unknown' }} Table: {{ $auditLog->table_name }}

When: {{ \App\Support\CalendarDate::format($auditLog->action_at, 'Y-m-d H:i:s', '-') }}

By: {{ $auditLog->admin_user_name ?: 'System/Unknown' }}

Email: {{ $auditLog->admin_user_email ?: '-' }}

Model: {{ class_basename($auditLog->model_type) }}

Record UUID: {{ $auditLog->record_uuid ?: '-' }}

User UUID: {{ $auditLog->admin_user_uuid ?: '-' }}

IP: {{ $auditLog->ip_address ?: '-' }}

@if ($auditLog->action === 'insert' && is_array($auditLog->new_values) && $auditLog->new_values !== [])

Inserted Data

@foreach ($auditLog->new_values as $field => $value)

{{ $labelize($field) }}: {{ $formatValue($value) }}

@endforeach
@endif @if ($auditLog->action === 'update' && is_array($auditLog->new_values) && $auditLog->new_values !== [])

Updated Fields

@foreach ($auditLog->new_values as $field => $newValue) @endforeach
Field Previous Value New Value
{{ $labelize($field) }} {{ $formatValue($auditLog->old_values[$field] ?? null) }} {{ $formatValue($newValue) }}
@endif @if ($auditLog->action === 'delete' && is_array($auditLog->deleted_values) && $auditLog->deleted_values !== [])

Deleted Data

@foreach ($auditLog->deleted_values as $field => $value)

{{ $labelize($field) }}: {{ $formatValue($value) }}

@endforeach
@endif
No audit logs found yet.
{{ $auditLogs->links() }}