@extends('layouts.app') @section('title', 'Admin Dashboard') @section('content') @php $roleIcons = [ 'superadmin' => 'shield-lock', 'lecturer' => 'mortarboard', 'clinical_instructor' => 'clipboard2-pulse', 'student' => 'people', ]; $tone = fn (string $a) => match (true) { str_contains($a, 'delete') || str_contains($a, 'archive') => 'danger', str_contains($a, 'create') || str_contains($a, 'import') => 'success', str_contains($a, 'login') || str_contains($a, 'logout') => 'secondary', str_contains($a, 'impersonation') => 'warning', default => 'primary', }; @endphp

System Dashboard

{{ now()->format('l, d F Y') }} — accounts, activity and things needing attention.

@can('users.create') Add user @endcan @can('users.view') Manage users @endcan
{{-- ── Accounts by role ───────────────────────────────────────────────── --}}
@foreach($counts as $role => $count)
{{ $count }}
{{ str_replace('_', ' ', $role) }}
@endforeach
{{-- ── Needs attention ────────────────────────────────────────────── --}}
System health
    @php $items = [ ['label' => 'Students with no current semester', 'value' => $health['no_semester'], 'url' => route('admin.users.index', ['role' => 'student']), 'warn' => true], ['label' => 'Students with no CI assigned', 'value' => $health['unassigned'], 'url' => route('admin.assignments.index'), 'warn' => true], ['label' => 'Incomplete student profiles', 'value' => $health['incomplete'], 'url' => route('admin.users.index', ['role' => 'student']), 'warn' => true], ['label' => 'Deactivated accounts', 'value' => $health['inactive'], 'url' => route('admin.users.index', ['status' => 'inactive']), 'warn' => false], ['label' => 'Archived accounts', 'value' => $health['archived'], 'url' => route('admin.users.index', ['status' => 'archived']), 'warn' => false], ['label' => 'Unused invite codes', 'value' => $health['unused_invites'], 'url' => route('admin.invite-codes.index'), 'warn' => false], ]; @endphp @foreach($items as $item)
  • {{ $item['label'] }} {{ $item['value'] }}
  • @endforeach
Activity
{{ $activity['assessments_week'] }}
Assessed this week
{{ $activity['logins_today'] }}
Logins today
{{ number_format($activity['assessments_all']) }}
Assessments total
{{ $activity['reports'] }}
Clinical reports
{{-- ── Audit trail ────────────────────────────────────────────────── --}}
Recent activity
@can('audit.view') View all @endcan
@forelse($recentLogs as $log) @empty @endforelse
Action By Description When
{{ str_replace('_', ' ', $log->action) }} {{ $log->user?->name ?? 'System' }} {{ Str::limit($log->description, 70) }} {{ $log->created_at?->diffForHumans(short: true) }}
No activity recorded yet.
@endsection