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 + +
merge(['class' => 'relative overflow-hidden rounded-2xl border border-slate-200 bg-white']) }}> +
+
+
+
+
+ {{ $badge }} +
+

{{ $title }}

+ @if ($description) +

{{ $description }}

+ @endif + @isset($actions) +
+ {{ $actions }} +
+ @endisset +
+ + @if (count($stats) > 0) +
+ @foreach ($stats as $stat) +
+

{{ $stat['value'] }}

+

{{ $stat['label'] }}

+
+ @endforeach +
+ @endif +
+
+
diff --git a/resources/views/hosting/type.blade.php b/resources/views/hosting/type.blade.php index 45e11d1..93ab4ef 100644 --- a/resources/views/hosting/type.blade.php +++ b/resources/views/hosting/type.blade.php @@ -50,28 +50,48 @@ || $hostingAccounts->isNotEmpty() || $rcHostingOrders->isNotEmpty() || $rcServiceOrders->isNotEmpty(); + + $heroMeta = match ($type) { + \App\Models\HostingProduct::TYPE_SINGLE_DOMAIN => [ + 'badge' => 'One site · SSL · cPanel', + 'title' => 'Single domain hosting', + 'description' => 'Reliable hosting for one website — link your domain and go live.', + ], + \App\Models\HostingProduct::TYPE_MULTI_DOMAIN => [ + 'badge' => 'Multiple sites · Shared resources', + 'title' => 'Multi domain hosting', + 'description' => 'Host several websites on one account with separate domains.', + ], + \App\Models\HostingProduct::TYPE_WORDPRESS => [ + 'badge' => 'Managed · Optimized · One-click install', + 'title' => 'WordPress hosting', + 'description' => 'Fast, managed WordPress with automatic updates and easy staging.', + ], + default => [ + 'badge' => 'Web hosting', + 'title' => $title, + 'description' => 'Manage your hosting products and orders.', + ], + }; @endphp
- {{-- Page Header --}} -
-
-
- @if ($type === \App\Models\HostingProduct::TYPE_WORDPRESS) - @include('partials.wordpress-icon', ['class' => 'h-9 w-9 object-contain']) - @endif -

{{ $title }}

-
-

Manage your {{ strtolower($title) }} products and orders.

-
+ @if ($nativeForm && ($nativeForm['has_packages'] ?? false)) - + + New product + @endif -
+ {{-- Products List --}} @if ($hasAnyProducts)