@extends('admin.layout.tamplate') @section('content')
{{-- Header Section --}}
@include('admin.layout.breadcumb')
{{-- Global Filter (Range Waktu) --}}
{{-- Statistik Ringkasan --}}
@php $stats_cards = [ ['label' => 'Total Hits', 'value' => $total_visitors ?? 0, 'icon' => 'fa-eye', 'color' => 'sky'], [ 'label' => 'Unique Visitor', 'value' => $unique_ips ?? 0, 'icon' => 'fa-user-check', 'color' => 'emerald', ], [ 'label' => 'Total Log', 'value' => $visitors->total(), 'icon' => 'fa-fingerprint', 'color' => 'amber', ], ]; @endphp @foreach ($stats_cards as $s)

{{ $s['label'] }}

{{ number_format($s['value']) }}

@endforeach
{{-- Halaman Terpopuler --}}

Halaman Terpopuler

@forelse($top_pages as $page)
/{{ ltrim($page->accessed_page, '/') ?: 'home' }} {{ number_format($page->total) }} Hits
@php $max_count = $top_pages->first()->total ?? 1; $width = ($page->total / $max_count) * 100; @endphp
@empty

Belum ada data

@endforelse
{{-- Log Table with Search --}}

Rincian Log Pengunjung

Live Traffic Feed

{{-- Search Form --}}
{{-- Keep the range filter value --}}
@if (request('search')) @endif
@forelse($visitors as $v) @empty @endforelse
Waktu IP & Lokasi Sistem Target
{{ $v->created_at->format('d/m/y') }} {{ $v->created_at->format('H:i:s') }}
{{ $v->ip_address }} {{ $v->location ?? 'Indonesia' }}
@php $os_v = strtolower($v->os); // $os_icon = ''; if (Str::contains($os_v, 'windows')) { $os_icon = 'fa-windows'; } elseif (Str::contains($os_v, 'android')) { $os_icon = 'fa-android'; } elseif (Str::contains($os_v, 'mac')) { $os_icon = 'fa-apple'; } elseif (Str::contains($os_v, 'linux')) { $os_icon = 'fa-linux'; } @endphp
{{ $v->browser }} {{ Str::limit($v->device, 10) }}
/{{ ltrim($v->accessed_page, '/') ?: 'home' }}

Tidak ada data ditemukan.

{{ $visitors->appends(['range' => $filter, 'search' => request('search')])->links() }}
@endsection