@extends('layouts.app') @section('title') Admin | Audit Trail @endsection @section('css') @endsection @section('content') @component('components.breadcrumb') @slot('li_1') Admin Panel @endslot @slot('title') Audit Trail @endslot @endcomponent
Facility
@if(hasPermission(1210, 'can_add')) @endif
{{-- --}} @foreach ($logs as $log) {{-- --}} @endforeach
Date & Time Action ModuleRecord IDPerformed By IP Address Related Data Details
{{ \Carbon\Carbon::parse($log->created_at)->format('Y-m-d H:i:s') }} @if($log->description == 'created') Created @elseif($log->description == 'updated') Updated @elseif($log->description == 'deleted') Deleted @else {{ ucfirst($log->description) }} @endif @php $module = class_basename($log->subject_type); @endphp {{ $module }} {{ $log->subject_id }} @php $causer = $log->causer ?? null; @endphp {{ $causer ? ($causer->name ?? $causer->email ?? 'System') : 'System' }} @php $properties = is_array($log->properties) ? $log->properties : json_decode($log->properties, true); @endphp {{ $properties['ip'] ?? '-' }} @php // Show a summary of related data (attributes) $related = $properties['attributes'] ?? []; @endphp @if(!empty($related)) @if(isset($related['name'])) Name: {{ $related['name'] }}
@endif @if(isset($related['email'])) Email: {{ $related['email'] }}
@endif @if(isset($related['code'])) Code: {{ $related['code'] }}
@endif @if(isset($related['description'])) Description: {{ $related['description'] }}
@endif @if(isset($related['role_id'])) Role ID: {{ $related['role_id'] }}
@endif {{-- Add more fields as needed --}} @else - @endif
@if(isset($properties['attributes']))
New Data:
{{ json_encode($properties['attributes'], JSON_PRETTY_PRINT) }}
@if(isset($properties['old'])) Previous Data:
{{ json_encode($properties['old'], JSON_PRETTY_PRINT) }}
@endif
@else - @endif
@endsection