<?php

namespace Database\Seeders;

use App\Models\ProductRack;
use Illuminate\Database\Seeder;

class ProductRackSeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        $name = 'Etalase 1';

        // Cek apakah sudah ada data dengan name ini
        $exists = ProductRack::where('name', $name)->exists();

        if (!$exists) {
            ProductRack::create([
                'name' => $name,
                'desc' => 'Etalase awal',
            ]);
        }
    }
}
