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

Audit Log Details

Basic Information
Log ID: {{ $auditLog->id }}
Event: {{ $auditLog->formatted_event }}
Model: {{ class_basename($auditLog->auditable_type) }} @if($auditLog->auditable_id)
ID: {{ $auditLog->auditable_id }} @endif
User: @if($auditLog->user) {{ $auditLog->user->name }}
{{ $auditLog->user->email }} @else System @endif
Date/Time: {{ $auditLog->created_at->format('M d, Y H:i:s') }}
{{ $auditLog->created_at->diffForHumans() }}
Changes: {{ $auditLog->changes_count }} changes
{{ $auditLog->change_summary }}
Request Information
IP Address: @if($auditLog->ip_address) {{ $auditLog->ip_address }} @else Not available @endif
Method: @if($auditLog->method) {{ $auditLog->method }} @else Not available @endif
URL: @if($auditLog->url) {{ $auditLog->url }} @else Not available @endif
User Agent: @if($auditLog->user_agent) {{ $auditLog->user_agent }} @else Not available @endif
Tags: @if($auditLog->tags && count($auditLog->tags) > 0) @foreach($auditLog->tags as $tag) {{ $tag }} @endforeach @else None @endif
@if($auditLog->event === 'updated' && $auditLog->changed_fields)
Changes Details
@foreach($auditLog->changed_fields as $field) @endforeach
Field Old Value New Value
{{ $field }} @if(isset($auditLog->old_values[$field])) {{ is_array($auditLog->old_values[$field]) ? json_encode($auditLog->old_values[$field]) : $auditLog->old_values[$field] }} @else - @endif @if(isset($auditLog->new_values[$field])) {{ is_array($auditLog->new_values[$field]) ? json_encode($auditLog->new_values[$field]) : $auditLog->new_values[$field] }} @else - @endif
@endif @if($auditLog->event === 'created' || $auditLog->event === 'deleted')
{{ $auditLog->event === 'created' ? 'Created Data' : 'Deleted Data' }}
@if($auditLog->event === 'created' && $auditLog->new_values)
{{ json_encode($auditLog->new_values, JSON_PRETTY_PRINT) }}
@elseif($auditLog->event === 'deleted' && $auditLog->old_values)
{{ json_encode($auditLog->old_values, JSON_PRETTY_PRINT) }}
@else No data available @endif
@endif @if($auditLog->notes)
Notes

{{ $auditLog->notes }}

@endif
@endsection