<?php

namespace Database\Seeders;

use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\DB;

class produkseeder extends Seeder
{
    /**
     * Run the database seeds.
     */
    public function run(): void
    {
        for ($i = 1; $i <= 3; $i++) {
            DB::table('produks')->insert([
                'nama_produk' => 'Produk ' . $i,
                'kategori' => ['Elektronik', 'Makanan', 'Pakaian'][rand(0, 2)],
                'harga' => rand(10000, 100000),
                'stok' => rand(1, 50),
                'gambar' => null,
                'deskripsi' => 'Deskripsi produk ke-' . $i,
                'created_at' => now(),
                'updated_at' => now(),
            ]);
        }
    }
}
