@extends('layouts.admin') @section('title', 'Detalhe do Log') @section('breadcrumb') Auditoria / Log #{{ $auditLog->id }} @endsection @push('styles') @endpush @section('content') @php $oldVals = $auditLog->old_values ?? []; $newVals = $auditLog->new_values ?? []; $allKeys = collect(array_unique(array_merge(array_keys($oldVals), array_keys($newVals))))->sort(); $actionColors = [ 'created' => ['bg'=>'#dcfce7','color'=>'#16a34a'], 'updated' => ['bg'=>'#dbeafe','color'=>'#2563eb'], 'deleted' => ['bg'=>'#fee2e2','color'=>'#dc2626'], 'canceled' => ['bg'=>'#fce7f3','color'=>'#be185d'], 'payment' => ['bg'=>'#d1fae5','color'=>'#059669'], 'checkout' => ['bg'=>'#fef3c7','color'=>'#d97706'], ]; $ac = $actionColors[$auditLog->action] ?? ['bg'=>'#f1f5f9','color'=>'#475569']; @endphp
Voltar à Auditoria
{{ strtoupper($auditLog->action) }}
Log de Auditoria #{{ $auditLog->id }}
{{ $auditLog->created_at->format('d/m/Y H:i:s') }} · {{ $auditLog->created_at->diffForHumans() }}
{{-- Metadados --}}
Informações do Evento
Entidade{{ ucfirst($auditLog->entity_type) }}
ID da Entidade#{{ $auditLog->entity_id ?? '—' }}
Ação{{ $auditLog->action }}
@if($auditLog->reason)
Motivo{{ $auditLog->reason }}
@endif
Rastreamento
Usuário{{ $auditLog->user?->display_name ?? 'Sistema' }}
E-mail{{ $auditLog->user?->email ?? '—' }}
IP{{ $auditLog->ip_address ?? '—' }}
Request ID{{ $auditLog->request_id ?? '—' }}
{{-- Diff --}} @if($allKeys->isNotEmpty())
Diff — Valores Anteriores vs. Novos
← Antes
@foreach($allKeys as $key)
{{ $key }} {{ is_array($oldVals[$key] ?? null) ? json_encode($oldVals[$key]) : ($oldVals[$key] ?? '—') }}
@endforeach
Depois →
@foreach($allKeys as $key)
{{ $key }} {{ is_array($newVals[$key] ?? null) ? json_encode($newVals[$key]) : ($newVals[$key] ?? '—') }}
@endforeach
@else
Nenhum dado de diff disponível para este evento.
@endif @endsection