@extends('layouts.app') @section('content')
Audit Log Details

Log ID: #{{ $auditLog->id }}

Tracked activity on the system

@php $actionColors = [ 'created' => 'success', 'updated' => 'warning', 'deleted' => 'danger' ]; @endphp {{ ucfirst($auditLog->action) }}

{{ $auditLog->table_name }}

#{{ $auditLog->record_id }}

{{ ucfirst($auditLog->action) }}

@if($auditLog->user) {{ $auditLog->user->name }}
{{ $auditLog->user->email }} @else System @endif

{{ $auditLog->created_at->format('M d, Y H:i:s A') }}

#{{ $auditLog->id }}

@if($auditLog->description)
{{ $auditLog->description }}
@endif @if($auditLog->changes)
@php $changes = json_decode($auditLog->changes, true); @endphp @if(is_array($changes) && count($changes) > 0)
@foreach($changes as $field => $change) @endforeach
Field Old Value New Value
{{ $field }} @if(is_array($change) && isset($change['old'])) @if(is_array($change['old']) || is_object($change['old'])) {{ json_encode($change['old']) }} @else {{ $change['old'] ?? 'Empty' }} @endif @else N/A @endif @if(is_array($change) && isset($change['new'])) @if(is_array($change['new']) || is_object($change['new'])) {{ json_encode($change['new']) }} @else {{ $change['new'] ?? 'Empty' }} @endif @else N/A @endif
@else

No detailed changes recorded.

@endif
@endif
@auth @if(Auth::user()->is_admin)
@csrf @method('DELETE')
@endif @endauth
@endsection