@extends('layouts.dashboard') @section('title', 'Audit Logs') @section('page-title', 'Audit Logs') @section('content')
Admin Activity Audit

Track all admin actions for security and compliance

Clear
@forelse($auditLogs as $log) @empty @endforelse
Timestamp Admin Action Resource Details IP Address
{{ $log->created_at->format('M d, Y') }}
{{ $log->created_at->format('H:i:s') }}
{{ strtoupper(substr($log->admin->name ?? 'X', 0, 2)) }}
{{ $log->admin->name ?? 'Unknown' }}
{{ $log->admin->email ?? '' }}
@php $actionColor = match($log->action) { 'login' => 'success', 'logout' => 'secondary', 'create' => 'primary', 'update' => 'info', 'delete' => 'danger', 'toggle_status' => 'warning', 'force_logout' => 'warning', 'reset_password' => 'warning', 'permission_denied' => 'danger', 'view_sensitive' => 'dark', default => 'secondary', }; @endphp {{ ucwords(str_replace('_', ' ', $log->action)) }} @if($log->resource_type) {{ ucfirst($log->resource_type) }} @if($log->resource_id) #{{ $log->resource_id }} @endif @else - @endif @if($log->new_values || $log->old_values) @else - @endif {{ $log->ip_address ?? 'N/A' }}
No audit logs found
@if($auditLogs->hasPages())
{{ $auditLogs->withQueryString()->links() }}
@endif
{{ App\Models\AdminAuditLog::where('action', 'login')->whereDate('created_at', today())->count() }}
Logins Today
{{ App\Models\AdminAuditLog::whereIn('action', ['create', 'update', 'delete'])->whereDate('created_at', today())->count() }}
Changes Today
{{ App\Models\AdminAuditLog::where('action', 'permission_denied')->whereDate('created_at', today())->count() }}
Denied Access
{{ App\Models\AdminAuditLog::count() }}
Total Logs
@endsection