@extends('admin.layouts.app') @section('title', get_setting('site_name').' | '.__('Activity Log')) @section('content') @include('admin.Activity.partials.styles')

{{ __('Activity Log') }}

{{ __('What changed, who did it, and which module — at a glance.') }}

{{ number_format((int) ($stats['total'] ?? 0)) }}
{{ __('Total') }}
{{ number_format((int) ($stats['today'] ?? 0)) }}
{{ __('Today') }}
{{ number_format((int) ($stats['week'] ?? 0)) }}
{{ __('This Week') }}
{{ number_format((int) ($stats['users'] ?? 0)) }}
{{ __('Users') }}
{{ __('All') }} @foreach($modules as $moduleKey => $moduleLabel) {{ $moduleLabel }} @endforeach
@if(request()->filled('module')) @endif
@if(auth()->user()->user_type === 'admin') @endif
{{ __('Reset') }}
@forelse($activities as $activity) @php $actionClass = match ($activity->action_key ?? '') { 'created', 'login' => 'created', 'updated' => 'updated', 'deleted', 'logout' => 'deleted', default => 'other', }; $collapseId = 'act-chg-'.$activity->id; $actorName = $activity->user?->name ?? ($activity->actor_fallback ?? null) ?? '—'; $initials = collect(preg_split('/\s+/', trim($actorName))) ->filter() ->take(2) ->map(fn ($p) => mb_strtoupper(mb_substr($p, 0, 1))) ->implode(''); if ($initials === '' || $actorName === '—') { $initials = '?'; } @endphp
{{ $activity->module_label }} {{ $activity->action_label }} @if(!empty($activity->reference)) {{ $activity->reference }} @endif

{{ $activity->summary }}

{{ $activity->relative_at }} · {{ $activity->formatted_at }} @if($activity->ip) · {{ $activity->ip }} @endif
@if(!empty($activity->change_lines))
@foreach($activity->change_lines as $line)
{{ $line['field'] }}
@if($line['from'] !== null && $line['to'] !== null) {{ $line['from'] }} {{ $line['to'] }} @elseif($line['to'] !== null) {{ $line['to'] }} @else {{ $line['from'] }} @endif
@endforeach
@endif
@empty
{{ __('No activity found') }}
{{ __('Try another module or clear filters.') }}
{{ __('Reset filters') }}
@endforelse
@if($activities->hasPages()) @endif
@endsection @section('script') @endsection