<?php

namespace Database\Seeders;

use Illuminate\Database\Seeder;
use App\Models\Product;
use App\Models\Category;
use Illuminate\Support\Str;

class ProductSeeder extends Seeder
{
    public function run(): void
    {
        $category = Category::first();
        if (!$category) return;

        Product::create([
            'category_id' => $category->id,
            'name' => 'Sample Digital Product 1',
            'slug' => Str::slug('Sample Digital Product 1'),
            'description' => 'This is a sample digital product',
            'price' => 50000,
            'drive_link' => 'https://drive.google.com/file/d/123456789/view',
            'is_active' => true,
        ]);
        
        $category = Category::skip(1)->first();
        if ($category) {
            Product::create([
                'category_id' => $category->id,
                'name' => 'Premium Landing Page Template',
                'slug' => Str::slug('Premium Landing Page Template'),
                'description' => 'A clean premium tailwind landing page.',
                'price' => 150000,
                'drive_link' => 'https://drive.google.com/file/d/987654321/view',
                'is_active' => true,
            ]);
        }
    }
}
