@extends('layouts.app') @section('content')

Audit Log

Track all changes made across the system.

Clear
@forelse($logs ?? [] as $index => $log) @empty @endforelse
Date/Time User Module Action Target Details
{{ $log->created_at->format('d M Y') }}
{{ $log->created_at->format('H:i:s') }}
{{ $log->user_name ?? 'System' }}
@if($log->user_role) {{ ucfirst($log->user_role) }} @endif
@php $moduleColors = [ 'Staff' => 'bg-cyan-100 text-cyan-700', 'Finance' => 'bg-green-100 text-green-700', 'Expenses' => 'bg-red-100 text-red-700', 'Transfers' => 'bg-blue-100 text-blue-700', 'Invoices' => 'bg-yellow-100 text-yellow-700', 'Assets' => 'bg-orange-100 text-orange-700', 'CRM' => 'bg-indigo-100 text-indigo-700', 'Settings' => 'bg-gray-100 text-gray-700', 'Petty Cash' => 'bg-amber-100 text-amber-700', ]; $mColor = $moduleColors[$log->module] ?? 'bg-gray-100 text-gray-700'; @endphp {{ ucfirst($log->module) }} @php $actionStyles = [ 'created' => 'bg-green-100 text-green-700', 'updated' => 'bg-blue-100 text-blue-700', 'deleted' => 'bg-red-100 text-red-700', 'exported' => 'bg-purple-100 text-purple-700', ]; $aStyle = $actionStyles[$log->action] ?? 'bg-gray-100 text-gray-700'; @endphp {{ ucfirst($log->action) }} {{ $log->target }}
@if($log->details)
{{ json_encode($log->details, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE) }}
@else

No additional details.

@endif
No audit logs found.
@if(isset($logs) && $logs->hasPages())
{{ $logs->links() }}
@endif
@endsection