<?php

declare(strict_types=1);

namespace Database\Seeders;

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

class NovaCardCategorySeeder extends Seeder
{
    public function run(): void
    {
        $categories = [
            ['slug' => 'motivation', 'name' => 'Motivation'],
            ['slug' => 'love', 'name' => 'Love'],
            ['slug' => 'life', 'name' => 'Life'],
            ['slug' => 'happiness', 'name' => 'Happiness'],
            ['slug' => 'healing', 'name' => 'Healing'],
            ['slug' => 'friendship', 'name' => 'Friendship'],
            ['slug' => 'aesthetic', 'name' => 'Aesthetic'],
            ['slug' => 'minimal', 'name' => 'Minimal'],
            ['slug' => 'dark-mood', 'name' => 'Dark Mood'],
            ['slug' => 'poetry', 'name' => 'Poetry'],
            ['slug' => 'wallpaper-quotes', 'name' => 'Wallpaper Quotes'],
        ];

        foreach ($categories as $index => $category) {
            NovaCardCategory::query()->updateOrCreate(
                ['slug' => $category['slug']],
                [
                    'name' => $category['name'],
                    'description' => sprintf('%s cards and shareable quote visuals.', $category['name']),
                    'active' => true,
                    'order_num' => $index,
                ]
            );
        }
    }
}
