@extends('admin.layouts.app') @section('title', 'Audit Logs') @section('content')

Audit Logs

Track all admin activities and system changes

Export CSV
@include('admin.components.stat_card', ['label' => 'Total Logs', 'value' => $stats['total'], 'icon' => 'fa-solid fa-clipboard-list', 'color' => 'slate']) @include('admin.components.stat_card', ['label' => 'Today', 'value' => $stats['today'], 'icon' => 'fa-solid fa-calendar-day', 'color' => 'blue']) @include('admin.components.stat_card', ['label' => 'This Week', 'value' => $stats['this_week'], 'icon' => 'fa-solid fa-calendar-week', 'color' => 'green']) @include('admin.components.stat_card', ['label' => 'This Month', 'value' => $stats['this_month'], 'icon' => 'fa-solid fa-calendar-alt', 'color' => 'indigo'])
Clear All
@if($logs->count() > 0)
@foreach($logs as $log)
@if($log->action === 'create') @elseif($log->action === 'update') @elseif($log->action === 'delete') @else @endif

{{ $log->description }}

{{ $log->admin->name ?? 'Unknown' }} {{ ucfirst($log->action) }} @if($log->target_type) {{ $log->target_type }} @if($log->target_id) #{{ $log->target_id }} @endif @endif @if($log->ip_address) {{ $log->ip_address }} @endif {{ $log->created_at->diffForHumans() }}
@if($log->metadata && is_array($log->metadata) && count($log->metadata) > 0)
@endif
@endforeach
{{ $logs->links() }}
@else

No audit logs found matching your filters.

@endif
@if($topActions->count() > 0)

Most Common Actions

@foreach($topActions as $action)
{{ $action->action }} {{ number_format($action->count) }}
@endforeach
@endif
@endsection