@extends('layouts.user_type.auth') @section('home')
@include('components.alert')

Dashboard

Welcome back, {{ auth()->user()->name }} — here's what's happening.

{{ \Carbon\Carbon::now()->format('d M, Y') }}
{{-- Database backup status (from the crontab backup script) --}} @if (hasPermission('backupLog', 'view') && \Illuminate\Support\Facades\Schema::hasTable('backup_logs')) @php $qcLb = \App\Models\Admin\BackupLog::lastSuccess(); $qcStale = !$qcLb || $qcLb->ran_at->lt(now()->subHours(\App\Models\Admin\BackupLog::STALE_AFTER_HOURS)); @endphp @if($qcLb) Last database backup {{ $qcLb->ran_at->diffForHumans() }} ({{ $qcLb->ran_at->format('d M Y, H:i') }} · {{ $qcLb->size_for_humans }}){{ $qcStale ? ' — overdue, check the backup crontab.' : '.' }} @else No database backup recorded yet — connect the crontab backup script. @endif View backups @endif
All
{{ $total_company }}
Total Companies
Active
{{ $subscribed_company }}
Subscribed
Action
{{ $expired_company }}
Expired
@if (auth()->user()->user_type == 'admin' || auth()->user()->user_type == 'super_admin')
System
{{ $total_user }}
Total Users
@else
Pending
{{ $openTicketsCount }}
Open Tickets
@endif

System Health

Cron Job Monitor

{{ $cron_errors_24h ?? '0' }}

Errors in last 24h

Last run: {{ $last_cron_run ?? 'Just now' }}

Traffic

Visitor Tracking

{{ $visits_today ?? '0' }}

Visits Today

{{ $visits_today_percentage ?? '+0%' }}

7-Day Total: {{ $visits_7_day_total ?? '0' }}

Inquiries

Contact Requests

{{ $contact_us_today ?? '0' }}

Requests Today

{{ $contact_us_percentage ?? '+0%' }}

7-Day Total: {{ $contact_us_7_day_total ?? '0' }}

Upcoming Expirations

Companies requiring attention in the next billing cycle.

{{ $subscriptions->total() }} Alert(s)
@forelse($subscriptions as $index => $subscription) @php $days = $subscription['days']; $isExpired = $days < 0; @endphp @empty @endforelse
# Company Package Status Expiry Date Time Left
{{ str_pad($loop->iteration, 2, '0', STR_PAD_LEFT) }} {{ $subscription['company_name'] }} {{ $subscription['package_name'] }} {{ $isExpired ? 'Expired' : 'Expiring Soon' }} {{ \Carbon\Carbon::parse($subscription['expires_at'])->format('d M, Y') }} {{ $isExpired ? abs($days).' days overdue' : $days.' days left' }}

All caught up — no upcoming expirations!

@if($subscriptions->hasPages())
@include('components.pagination', ['paginator' => $subscriptions])
@endif
@endsection