diff --git a/app/Http/Controllers/Hosting/HostingProductController.php b/app/Http/Controllers/Hosting/HostingProductController.php index 2b54c3a..d808b48 100644 --- a/app/Http/Controllers/Hosting/HostingProductController.php +++ b/app/Http/Controllers/Hosting/HostingProductController.php @@ -107,6 +107,19 @@ class HostingProductController extends Controller $nativeForm = $this->nativeHostingProductForm($type); $userDomains = $this->getUserDomains($user); + $pendingStatuses = ['pending_payment', 'pending_approval', 'approved', 'provisioning']; + $heroStats = [ + 'accounts' => $hostingAccounts->count(), + 'active' => $hostingAccounts->where('status', 'active')->count() + + $orders->where('status', 'active')->count() + + $rcHostingOrders->where('status', 'active')->count() + + $rcServiceOrders->where('status', 'active')->count(), + 'pending' => $orders->whereIn('status', $pendingStatuses)->count() + + $rcHostingOrders->whereIn('status', $pendingStatuses)->count() + + $rcServiceOrders->whereIn('status', $pendingStatuses)->count(), + 'plans' => count($nativeForm['packages'] ?? []), + ]; + return view('hosting.type', [ 'title' => $title, 'type' => $type, @@ -117,6 +130,7 @@ class HostingProductController extends Controller 'marketingCategory' => $marketingCategory, 'nativeForm' => $nativeForm, 'userDomains' => $userDomains, + 'heroStats' => $heroStats, ]); } diff --git a/resources/css/app.css b/resources/css/app.css index 16f9abf..d387698 100644 --- a/resources/css/app.css +++ b/resources/css/app.css @@ -69,6 +69,16 @@ } } +.mobile-stats-card { + width: calc(66.666667% - 0.5rem); +} + +@media (min-width: 640px) { + .mobile-stats-card { + width: auto; + } +} + /* Ladill app launcher — cap at 5 rows (15 apps), always-visible scroll indicator */ .ladill-launcher-apps-wrap { position: relative; diff --git a/resources/views/components/hosting/page-hero.blade.php b/resources/views/components/hosting/page-hero.blade.php new file mode 100644 index 0000000..47e2daa --- /dev/null +++ b/resources/views/components/hosting/page-hero.blade.php @@ -0,0 +1,47 @@ +@props([ + 'badge', + 'title', + 'description' => null, + 'stats' => [], +]) + +@php + $statCols = match (count($stats)) { + 4 => 'sm:grid-cols-2 lg:grid-cols-4', + 2 => 'sm:grid-cols-2', + default => 'sm:grid-cols-3', + }; +@endphp + +
{{ $description }}
+ @endif + @isset($actions) +Manage your {{ strtolower($title) }} products and orders.
-