@extends('layouts.admin') @section('title', 'User Analytics') @section('content') @push('styles') @endpush

User Analytics Dashboard

Export CSV
Active Users (7d)

{{ $activeUsers7 }}

Active Users (30d)

{{ $activeUsers30 }}

Login Activity Trend
Last 30 Days
Device Usage Statistics
Top IP Addresses
@foreach($ipStats as $ip) @endforeach
Network IP Activity Sessions
{{ $ip->ip }}
{{ $ip->count }}
Recent Activity Logs
View All
{{-- Changed from Platform --}} @foreach($recentLogs as $log) @php // Decode meta to access user_agent $meta = json_decode($log->meta, true); $ua = $meta['user_agent'] ?? ''; // Determine device icon $isMobile = preg_match('/(android|iphone|ipad)/i', $ua); $deviceIcon = $isMobile ? 'bi-phone' : 'bi-pc-display'; @endphp @endforeach
User Details Action Type DeviceOccurred
{{ $log->name }}
{{ $log->email }}
{{ ucfirst($log->action) }}
{{-- Limit the user agent string so it doesn't stretch the table --}} {{ Str::limit($ua, 25) }}
IP: {{ $meta['ip'] ?? '0.0.0.0' }}
{{ $log->created_at->diffForHumans() }}
@endsection @push('scripts') @endpush