@extends('layouts.app') @section('title', 'Audit Log') @section('content') @include('partials.flash') @php // Friendly label + colour per event family. $eventMeta = function ($e) { return match (true) { $e === 'auth.login' => ['Sign in', 'bg-primary/10 text-primary', 'login'], $e === 'auth.logout' => ['Sign out', 'bg-surface-container-high text-on-surface-variant', 'logout'], $e === 'auth.failed' => ['Failed sign-in', 'bg-error-container text-error', 'gpp_bad'], $e === 'auth.lockout' => ['Lockout', 'bg-error-container text-error', 'lock'], str_starts_with($e, 'auth.password') => ['Password', 'bg-gold/20 text-[#8a6d3b]', 'key'], str_starts_with($e, 'course') => ['Course', 'bg-primary/10 text-primary', 'school'], str_starts_with($e, 'settings') => ['Settings', 'bg-gold/20 text-[#8a6d3b]', 'settings'], str_starts_with($e, 'users') => ['Users', 'bg-secondary-container text-on-secondary-container', 'group'], default => [\Illuminate\Support\Str::headline($e), 'bg-surface-container-high text-on-surface-variant', 'bolt'], }; }; @endphp {{-- Filters --}}
search
@if($filters['q'] !== '' || $filters['event'] || $filters['from'] || $filters['to']) Clear @endif download Export CSV
{{-- Log table --}}
history

Activity ({{ $logs->total() }})

@forelse($logs as $log) @php [$label, $chip, $icon] = $eventMeta($log->event); @endphp @empty @endforelse
When User Event Description IP
{{ optional($log->created_at)->format('j M Y · H:i') }} @if($log->user) {{ $log->user->name }} {{ $log->user->email }} @else {{ $log->properties['email'] ?? 'Guest / system' }} @endif {{ $icon }} {{ $label }} {{ $log->description }} @php $props = $log->properties ?? []; @endphp @if(!empty($props['bounced_emails']) || !empty($props['failed_emails']))
chevron_right Emails to check
@if(!empty($props['bounced_emails']))

Welcome email rejected ({{ count($props['bounced_emails']) }}):

{{ implode(', ', $props['bounced_emails']) }}

@endif @if(!empty($props['failed_emails']))

Not created ({{ count($props['failed_emails']) }}):

{{ implode(', ', $props['failed_emails']) }}

@endif
@endif
{{ $log->ip_address ?? '—' }}
No audit entries match these filters.
@if($logs->hasPages())
{{ $logs->links() }}
@endif
@endsection