@extends('layouts.app') @section('content')

Admin Dashboard

User roles, app usage, reading activity, and notification publishing.

@if(session('success'))
{{ session('success') }}
@endif @if($errors->any())
{{ $errors->first() }}
@endif @if(!$trackingReady || !$notificationsReady)
Some GuideData feature tables are not ready yet. @if(!$trackingReady) Device/activity tracking tables are missing. @endif @if(!$notificationsReady) Notification tables are missing. @endif
@endif
Total Accounts
{{ number_format($stats['total_users']) }}
Admins
{{ number_format($stats['admins']) }}
Content Creators
{{ number_format($stats['content_creators']) }}
Readers
{{ number_format($stats['readers']) }}
Registered Devices
{{ number_format($stats['devices_total']) }}
Online Devices
{{ number_format($stats['devices_online']) }}
Seen in last 15 minutes
Accounts Using App
{{ number_format($stats['active_accounts']) }}
Accounts with recorded device activity
Topic Reads
{{ number_format($stats['topic_reads']) }}
Today: {{ number_format($stats['reads_today']) }}
Notifications
{{ number_format($stats['notifications_total']) }}
Published today: {{ number_format($stats['notifications_today']) }}
Accounts Using the App
@forelse($recentDevices as $device) @empty @endforelse
User Type Device Last Seen Status
{{ $device->user->name ?? 'Unknown user' }}
{{ $device->user->email ?? '—' }}
{{ $device->user?->typeLabel() ?? 'Unknown' }}
{{ $device->device_name ?: 'Unnamed device' }}
{{ strtoupper($device->platform ?: 'unknown') }} @if($device->app_version) / {{ $device->app_version }} @endif
{{ optional($device->last_seen_at)->format('Y-m-d H:i') ?? '—' }}
Login: {{ optional($device->last_login_at)->format('Y-m-d H:i') ?? '—' }}
@if($device->isOnline()) Online @else Offline @endif
No app usage recorded yet.
Recent Reading Activity
@forelse($recentReads as $read) @empty @endforelse
Read At User Topic Resource
{{ optional($read->read_at)->format('Y-m-d H:i') ?? '—' }}
{{ $read->source ?: 'mobile' }}
{{ $read->user->name ?? 'Unknown user' }}
{{ $read->user?->typeLabel() ?? 'Unknown' }}
{{ $read->category_title ?: $read->category_id }}
{{ $read->document_title ?: 'Topic opened' }}
{{ strtoupper($read->document_type ?: 'unknown') }}
No reading activity recorded yet.
Recent Notifications
@forelse($recentNotifications as $notification) @empty @endforelse
Title Audience Created By Published Reads Channel
{{ $notification->title }}
{{ \Illuminate\Support\Str::limit($notification->message, 100) }}
{{ $notification->target_type ? ($typeLabels[$notification->target_type] ?? ('Type '.$notification->target_type)) : 'All guide users' }}
{{ $notification->creator->name ?? 'Unknown' }}
{{ $notification->creator?->typeLabel() ?? 'Unknown' }}
{{ optional($notification->published_at)->format('Y-m-d H:i') ?? 'Draft' }} {{ number_format($notification->reads_count ?? 0) }}
in_app
@if($notification->opensDocument()) Open resource @elseif($notification->opensCategory()) Open topic @else Feed only @endif
No notifications published yet.
@endsection