count(); $totalGates = Gate::where('is_active', true)->count(); $todayVerifications = VehicleActivity::whereDate('recorded_at', Carbon::today())->count(); $totalRejections = VehicleActivity::where('validation_status', 'rejected')->count(); // Log Verifikasi Gerbang Terkini (Panel Kiri) $recentActivities = VehicleActivity::with(['vehicle', 'driver', 'gate', 'securityGuard']) ->latest('recorded_at') ->take(5) ->get(); // Personel Satpam Terkini per Regu (Panel Kanan Atas) $recentGuards = SecurityGuard::with('gate') ->orderBy('team') ->take(5) ->get(); // Ringkasan Jumlah Personel per Regu Tugas (Panel Kanan Bawah) $team1Count = SecurityGuard::where('team', 1)->where('is_active', true)->count(); $team2Count = SecurityGuard::where('team', 2)->where('is_active', true)->count(); $team3Count = SecurityGuard::where('team', 3)->where('is_active', true)->count(); return view('pg.dashboard', compact( 'totalGuards', 'activeGuards', 'totalGates', 'todayVerifications', 'totalRejections', 'recentActivities', 'recentGuards', 'team1Count', 'team2Count', 'team3Count' )); } }