@extends('layouts.portal') @section('title', 'Audit log') @section('subtitle', 'Who changed what and when. Entries cannot be edited or deleted from the portal.') @section('content') @php $tone = function (string $action) { $verb = \Illuminate\Support\Str::afterLast($action, '.'); return match (true) { in_array($verb, ['deleted', 'revoked', 'voided', 'rejected', 'unpublished', 'refunded', 'cancelled'], true) => 'pill-red', in_array($verb, ['saved', 'created', 'added', 'published', 'issued', 'updated', 'confirmed', 'activated'], true) => 'pill-green', default => 'pill-blue', }; }; @endphp @if($logs->isEmpty())
@if($filters)Clear filters@endif
@else
@foreach($logs as $l) @endforeach
WhenUserActionRecordIP addressDetails
{{ $l->created_at?->format('d M Y') }}{{ $l->created_at?->format('g:i:s A') }} @if($l->user){{ $l->user->name }}{{ ucfirst($l->user->role) }}@elseSystem@endif {{ $l->action }} @if($l->entity_type){{ class_basename($l->entity_type) }}@if($l->entity_id) #{{ $l->entity_id }}@endif @else —@endif {{ $l->ip_address ?: '—' }} @if($l->before || $l->after)
View changes @if($l->before)
Before
{{ json_encode($l->before, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE) }}
@endif @if($l->after)
After
{{ json_encode($l->after, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE) }}
@endif
@else No extra details @endif
{{ $logs->links() }}

Showing the newest first. {{ number_format($total) }} {{ \Illuminate\Support\Str::plural('entry', $total) }} in total.

@endif @endsection