<?php

namespace Database\Seeders;

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

class CategorySeeder extends Seeder
{
    public function run(): void
    {
        $categories = [
            'Vases & Planters',
            'Wall Art & Mirrors',
            'Candles & Fragrance',
            'Lighting',
            'Cushions & Throws',
            'Table Décor',
            'Rugs & Carpets',
            'Clocks',
        ];

        foreach ($categories as $i => $name) {
            Category::firstOrCreate(
                ['slug' => Str::slug($name)],
                [
                    'name' => $name,
                    'description' => "Beautifully curated {$name} to elevate your home.",
                    'is_active' => true,
                    'sort_order' => $i,
                ]
            );
        }
    }
}
