@extends('layouts.admin-sidebar') @section('title', 'Security Logs') @section('page-title', 'Security & Audit Logs') @section('page-description', 'Monitor admin activities and security events') @section('content')

Security & Audit Logs

Monitor admin activities, user actions, and security events

@if(auth('admin')->user()->is_super_admin) @endif

Total Logs

{{ number_format($stats['total_logs']) }}

All time records

Today's Actions

{{ number_format($stats['today_actions']) }}

Last 24 hours

Active Admins

{{ number_format($stats['unique_admins']) }}

With activities

Login Attempts

{{ number_format($stats['login_attempts']) }}

All attempts

Filter Security Logs

Security & Audit Logs

Track all admin activities and security events

@if($logs->count() > 0)
@foreach($logs as $log) @endforeach
Admin & Action Target & Details IP Address & Location Timestamp Actions
{{ $log->admin ? strtoupper(substr($log->admin->name, 0, 2)) : 'SY' }}
{{ $log->admin ? $log->admin->name : 'System' }}
{{ ucwords(str_replace('_', ' ', $log->action)) }}
@if($log->target_type && $log->target_id) {{ $log->target_type }} #{{ $log->target_id }} @else General Action @endif
@if($log->data) @php $data = json_decode($log->data, true); @endphp @if(is_array($data) && count($data) > 0) {{ collect($data)->take(2)->map(function($value, $key) { return ucfirst($key) . ': ' . (is_string($value) ? Str::limit($value, 20) : $value); })->implode(', ') }} @endif @endif
{{ $log->ip_address }}
{{ getLocationFromIP($log->ip_address) }}
{{ $log->created_at->format('M j, Y') }}
{{ $log->created_at->format('g:i A') }}
@if($log->ip_address !== '127.0.0.1') @endif
{{ $logs->links() }}
@else

No logs found

No security logs match your current filters.

@endif

Recent Activity Summary

Most Common Actions (Last 30 Days)

@if($activityAnalytics['commonActions']->count() > 0) @php $maxCount = $activityAnalytics['commonActions']->max(); @endphp @foreach($activityAnalytics['commonActions'] as $action => $count)
{{ ucwords(str_replace('_', ' ', $action)) }}
{{ $count }}
@endforeach @else
No recent activity data available
@endif

Activity by Time (Last 7 Days)

@foreach($activityAnalytics['timeDistribution'] as $time => $percentage)
{{ $time }}
{{ $percentage }}%
@endforeach

Security Alerts

@foreach($securityAlerts as $alert)
@if($alert['icon'] === 'check-circle') @elseif($alert['icon'] === 'exclamation-triangle') @elseif($alert['icon'] === 'shield-check') @else @endif

{{ $alert['title'] }}

{{ $alert['message'] }}

@endforeach
@if(auth('admin')->user()->isSuperAdmin()) @endif @endsection