@extends('layouts.admin') @section('title', 'User Statistics') @section('content')

User Statistics

Comprehensive user analytics and insights

Back to Users
Total Users
{{ $stats['total_users'] }}
Active Last 30 Days
{{ $stats['active_users_last_30_days'] }}
With Applications
{{ $stats['users_with_applications'] }}
Without Applications
{{ $stats['users_without_applications'] }}
Users by Role
@if($stats['by_role']->count() > 0) @foreach($stats['by_role'] as $role => $count)
{{ ucfirst($role) }}
{{ $count }} ({{ $stats['total_users'] > 0 ? round(($count / $stats['total_users']) * 100, 1) : 0 }}%)
@endforeach @else

No role data available.

@endif
Users by Status
@if($stats['by_status']->count() > 0) @foreach($stats['by_status'] as $status => $count)
@php $statusColors = [ 'active' => 'success', 'inactive' => 'secondary', 'suspended' => 'warning' ]; $statusColor = $statusColors[$status] ?? 'secondary'; @endphp {{ ucfirst($status) }}
{{ $count }} ({{ $stats['total_users'] > 0 ? round(($count / $stats['total_users']) * 100, 1) : 0 }}%)
@endforeach @else

No status data available.

@endif
Registration Trends
@if($stats['registration_trends']->count() > 0)
@php $previousCount = 0; @endphp @foreach($stats['registration_trends'] as $month => $count) @php $previousCount = $count; @endphp @endforeach
Month New Registrations Percentage of Total Growth
{{ \Carbon\Carbon::createFromFormat('Y-m', $month)->format('F Y') }} {{ $count }} {{ $stats['total_users'] > 0 ? round(($count / $stats['total_users']) * 100, 1) : 0 }}% @if($previousCount > 0) @php $growth = (($count - $previousCount) / $previousCount) * 100; $growthColor = $growth >= 0 ? 'success' : 'danger'; $growthIcon = $growth >= 0 ? 'arrow-up' : 'arrow-down'; @endphp {{ abs(round($growth, 1)) }}% @else - @endif
@else
No Registration Data

No registration trends data available.

@endif
User Engagement
Users with Applications:
{{ $stats['users_with_applications'] }} ({{ $stats['total_users'] > 0 ? round(($stats['users_with_applications'] / $stats['total_users']) * 100, 1) : 0 }}%)
Users without Applications:
{{ $stats['users_without_applications'] }} ({{ $stats['total_users'] > 0 ? round(($stats['users_without_applications'] / $stats['total_users']) * 100, 1) : 0 }}%)
Active in Last 30 Days:
{{ $stats['active_users_last_30_days'] }} ({{ $stats['total_users'] > 0 ? round(($stats['active_users_last_30_days'] / $stats['total_users']) * 100, 1) : 0 }}%)
@php $engagementRate = $stats['total_users'] > 0 ? round(($stats['users_with_applications'] / $stats['total_users']) * 100, 1) : 0; $engagementColor = $engagementRate >= 50 ? 'success' : ($engagementRate >= 25 ? 'warning' : 'danger'); @endphp
{{ $engagementRate }}%
Overall Engagement Rate
@endsection