@extends('layouts.master') @section('title') Audit Trail @endsection @section('content') @component('components.breadcrumb') @slot('li_1') Administration @endslot @slot('title') Audit Trail @endslot @endcomponent
System Audit Trail
@forelse($logs as $log) @php $color = ['created'=>'success','updated'=>'info','deleted'=>'danger'][$log->action] ?? 'secondary'; @endphp @empty @endforelse
WhenUserActionRecordChangesIP
{{ $log->created_at?->format('d M Y H:i') }} {{ $log->user?->name ?? 'system' }}
{{ \App\Models\User::ROLE_LABELS[$log->user_role] ?? $log->user_role }}
{{ ucfirst($log->action) }} {{ $log->model_name }}
{{ $log->label }}
@php $new = $log->new_values ?? []; $old = $log->old_values ?? []; @endphp @if($log->action==='updated' && $new) @foreach($new as $k => $v) {{ $k }}: {{ \Illuminate\Support\Str::limit((string)($old[$k] ?? '∅'),40) }}{{ \Illuminate\Support\Str::limit(is_array($v)?json_encode($v):(string)$v,40) }} @endforeach @elseif($log->action==='created') {{ count($new) }} field(s) set @elseif($log->action==='deleted') record removed @endif {{ $log->ip_address }}
No audit records match.
{{ $logs->links('pagination::bootstrap-5') }}
@endsection