From 608e6947bf2233dfc2069f9ff78a25d7e6d75d85 Mon Sep 17 00:00:00 2001 From: isaacclad Date: Sat, 6 Jun 2026 20:01:05 +0000 Subject: [PATCH] Add server product catalog so VPS and dedicated pages can take orders. Seed Contabo-backed VPS and dedicated plans, open the order modal from dashboard links, and show clearer order CTAs when the catalog is empty. Co-authored-by: Cursor --- DEPLOY.md | 2 +- database/seeders/DatabaseSeeder.php | 13 +- database/seeders/ServerProductSeeder.php | 150 ++++++++++++++++++ resources/views/hosting/server-type.blade.php | 12 +- resources/views/servers/dashboard.blade.php | 12 +- 5 files changed, 167 insertions(+), 22 deletions(-) create mode 100644 database/seeders/ServerProductSeeder.php diff --git a/DEPLOY.md b/DEPLOY.md index 1e2c695..27e5499 100644 --- a/DEPLOY.md +++ b/DEPLOY.md @@ -62,7 +62,7 @@ Push to `main`, then: ```bash cd /var/www/ladill-servers/current php artisan migrate --force -php artisan db:seed --class=HostingProductSeeder --force +php artisan db:seed --class=ServerProductSeeder --force php artisan config:cache route:cache view:cache ``` diff --git a/database/seeders/DatabaseSeeder.php b/database/seeders/DatabaseSeeder.php index a81da2d..04f00fa 100644 --- a/database/seeders/DatabaseSeeder.php +++ b/database/seeders/DatabaseSeeder.php @@ -2,28 +2,17 @@ namespace Database\Seeders; -use App\Models\User; use Illuminate\Database\Console\Seeds\WithoutModelEvents; use Illuminate\Database\Seeder; -use Database\Seeders\HostingProductSeeder; class DatabaseSeeder extends Seeder { use WithoutModelEvents; - /** - * Seed the application's database. - */ public function run(): void { $this->call([ - HostingProductSeeder::class, - ]); - // User::factory(10)->create(); - - User::factory()->create([ - 'name' => 'Test User', - 'email' => 'test@example.com', + ServerProductSeeder::class, ]); } } diff --git a/database/seeders/ServerProductSeeder.php b/database/seeders/ServerProductSeeder.php new file mode 100644 index 0000000..67a697a --- /dev/null +++ b/database/seeders/ServerProductSeeder.php @@ -0,0 +1,150 @@ + 'VPS S', + 'slug' => 'vps-s', + 'description' => 'Entry-level VPS with 4 vCPU cores, 8 GB RAM, 75 GB NVMe SSD, and unlimited bandwidth. Perfect for small projects and development.', + 'category' => 'vps', + 'type' => 'vps', + 'price_monthly' => 0, + 'price_quarterly' => 0, + 'price_yearly' => 0, + 'currency' => 'GHS', + 'disk_gb' => 75, + 'bandwidth_gb' => null, + 'cpu_cores' => 3, + 'ram_mb' => 8192, + 'ssl_included' => true, + 'contabo_product_id' => 'V91', + 'contabo_region' => 'EU', + 'is_active' => true, + 'is_featured' => false, + 'is_visible' => true, + 'sort_order' => 10, + ], + [ + 'name' => 'VPS M', + 'slug' => 'vps-m', + 'description' => 'Mid-range VPS with 6 vCPU cores, 12 GB RAM, 100 GB NVMe SSD, and unlimited bandwidth. Ideal for growing applications and medium traffic sites.', + 'category' => 'vps', + 'type' => 'vps', + 'price_monthly' => 0, + 'price_quarterly' => 0, + 'price_yearly' => 0, + 'currency' => 'GHS', + 'disk_gb' => 100, + 'bandwidth_gb' => null, + 'cpu_cores' => 6, + 'ram_mb' => 12288, + 'ssl_included' => true, + 'contabo_product_id' => 'V94', + 'contabo_region' => 'EU', + 'is_active' => true, + 'is_featured' => true, + 'is_visible' => true, + 'sort_order' => 11, + ], + [ + 'name' => 'VPS L', + 'slug' => 'vps-l', + 'description' => 'High-performance VPS with 8 vCPU cores, 24 GB RAM, 200 GB NVMe SSD, and unlimited bandwidth. Built for demanding workloads and high-traffic applications.', + 'category' => 'vps', + 'type' => 'vps', + 'price_monthly' => 0, + 'price_quarterly' => 0, + 'price_yearly' => 0, + 'currency' => 'GHS', + 'disk_gb' => 200, + 'bandwidth_gb' => null, + 'cpu_cores' => 8, + 'ram_mb' => 24576, + 'ssl_included' => true, + 'contabo_product_id' => 'V97', + 'contabo_region' => 'EU', + 'is_active' => true, + 'is_featured' => false, + 'is_visible' => true, + 'sort_order' => 12, + ], + [ + 'name' => 'VPS XL', + 'slug' => 'vps-xl', + 'description' => 'Enterprise VPS with 12 vCPU cores, 48 GB RAM, 250 GB NVMe SSD, and unlimited bandwidth. Maximum performance for resource-intensive applications.', + 'category' => 'vps', + 'type' => 'vps', + 'price_monthly' => 0, + 'price_quarterly' => 0, + 'price_yearly' => 0, + 'currency' => 'GHS', + 'disk_gb' => 250, + 'bandwidth_gb' => null, + 'cpu_cores' => 12, + 'ram_mb' => 49152, + 'ssl_included' => true, + 'contabo_product_id' => 'V100', + 'contabo_region' => 'EU', + 'is_active' => true, + 'is_featured' => false, + 'is_visible' => true, + 'sort_order' => 13, + ], + [ + 'name' => 'Dedicated Entry', + 'slug' => 'dedicated-entry', + 'description' => 'Entry-level dedicated server with 12 CPU cores (AMD Ryzen 9 7900), 64 GB RAM, 1 TB NVMe SSD, and unlimited bandwidth. Full root access with no virtualization overhead.', + 'category' => 'dedicated', + 'type' => 'dedicated', + 'price_monthly' => 0, + 'price_yearly' => 0, + 'currency' => 'GHS', + 'disk_gb' => 1000, + 'bandwidth_gb' => null, + 'cpu_cores' => 12, + 'ram_mb' => 65536, + 'ssl_included' => true, + 'contabo_product_id' => 'amd-ryzen-12-cores', + 'is_active' => true, + 'is_featured' => false, + 'is_visible' => true, + 'sort_order' => 20, + ], + [ + 'name' => 'Dedicated Pro', + 'slug' => 'dedicated-pro', + 'description' => 'Professional dedicated server with 24 CPU cores (AMD EPYC 9224), 128 GB ECC RAM, 2 TB SSD storage, and unlimited bandwidth. Maximum power for enterprise workloads.', + 'category' => 'dedicated', + 'type' => 'dedicated', + 'price_monthly' => 0, + 'price_yearly' => 0, + 'currency' => 'GHS', + 'disk_gb' => 2000, + 'bandwidth_gb' => null, + 'cpu_cores' => 24, + 'ram_mb' => 131072, + 'ssl_included' => true, + 'contabo_product_id' => 'amd-genoa-24-cores', + 'is_active' => true, + 'is_featured' => true, + 'is_visible' => true, + 'sort_order' => 21, + ], + ]; + + foreach ($products as $product) { + HostingProduct::updateOrCreate( + ['slug' => $product['slug']], + $product + ); + } + } +} diff --git a/resources/views/hosting/server-type.blade.php b/resources/views/hosting/server-type.blade.php index 14706fb..96363df 100644 --- a/resources/views/hosting/server-type.blade.php +++ b/resources/views/hosting/server-type.blade.php @@ -20,7 +20,11 @@ 'server_password_confirmation', ]; $hasOrderFormErrors = collect($orderFormErrorFields)->contains(fn ($field) => $errors->has($field)); - $shouldOpenOrderModal = (bool) session('open_product_order_modal', false) || $hasOrderFormErrors; + $shouldOpenOrderModal = (bool) session('open_product_order_modal', false) + || $hasOrderFormErrors + || request()->boolean('order'); + + $orderButtonLabel = $type === 'vps' ? 'Order VPS' : 'Order dedicated server'; $initialServerStep = old('product_id') ? (($errors->has('server_password') || $errors->has('server_password_confirmation')) ? 3 : 2) @@ -91,7 +95,7 @@ @endif @@ -209,9 +213,11 @@ + @else +

Server plans are not available right now. Please contact support or try again later.

@endif @endif diff --git a/resources/views/servers/dashboard.blade.php b/resources/views/servers/dashboard.blade.php index c7faabd..db4dbd5 100644 --- a/resources/views/servers/dashboard.blade.php +++ b/resources/views/servers/dashboard.blade.php @@ -8,11 +8,11 @@

Your VPS and dedicated servers at a glance.

@@ -40,8 +40,8 @@

No servers yet

Deploy a VPS or dedicated server — configure region, image, and billing in minutes.

@else