@extends('admin.layouts.master') @section('title', 'Dashboard') @section('page-title', 'Dashboard') @section('breadcrumbs')@endsection @push('page-styles') @endpush @php $tiles = [ ['icon' => 'fa-building', 'label' => 'Companies', 'value' => $stats['companies'], 'soft' => 'soft-teal'], ['icon' => 'fa-circle-check', 'label' => 'Active', 'value' => $stats['active'], 'soft' => 'soft-green'], ['icon' => 'fa-circle-pause', 'label' => 'Inactive', 'value' => $stats['inactive'], 'soft' => 'soft-amber'], ]; @endphp @section('content')
{{-- Header --}}

Platform Dashboard

Overview of every company on the platform

{{ now()->format('l, d M Y') }}
{{-- KPI cards (companies only — no user counts) --}}
@foreach ($tiles as $t)
{{ number_format($t['value']) }}
{{ $t['label'] }}
@endforeach
{{-- Charts (side by side in one row) --}}
Company Growth — last 6 months
Company Status
{{-- Company → User mapping --}}
Companies & Assigned Users
@permission('companies.write') Add Company @endpermission
@forelse ($companies as $company) @empty @endforelse
CompanyEmailAssigned UserStatus
{{ $company->name }} {{ $company->email ?? '—' }} @if ($company->ownerMembership?->user) {{ strtoupper(substr($company->ownerMembership->user->name, 0, 1)) }} {{ $company->ownerMembership->user->name }} @else — not allocated — @endif {{ ucfirst($company->status) }}
No companies yet.
{{-- Platform-wide activity --}}
Recent Activity (All Companies)
@forelse ($recentActivity as $log) @empty @endforelse
UserCompanyActionDetailsWhen
{{ $log->user?->name ?? 'System' }} {{ $log->tenant?->name ?? '—' }} {{ ucfirst(str_replace('_', ' ', $log->action)) }} {{ $log->description ?? '—' }} {{ $log->created_at?->diffForHumans() }}
No activity yet.
@endsection @push('page-scripts') @endpush