<?php

namespace Database\Seeders;

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

class CategorySeeder extends Seeder
{
    public function run(): void
    {
        $tech = Category::create(['name' => 'Technology', 'slug' => 'technology', 'description' => 'All things tech.', 'is_active' => true, 'sort_order' => 1]);
        Category::create(['parent_id' => $tech->id, 'name' => 'Programming', 'slug' => 'programming', 'is_active' => true]);
        $ai = Category::create(['parent_id' => $tech->id, 'name' => 'AI & ML', 'slug' => 'ai-ml', 'is_active' => true]);
        Category::create(['parent_id' => $ai->id, 'name' => 'Large Language Models', 'slug' => 'large-language-models', 'is_active' => true]); // 3rd-level

        $life = Category::create(['name' => 'Lifestyle', 'slug' => 'lifestyle', 'is_active' => true, 'sort_order' => 2]);
        Category::create(['parent_id' => $life->id, 'name' => 'Travel', 'slug' => 'travel', 'is_active' => true]);
        Category::create(['parent_id' => $life->id, 'name' => 'Food', 'slug' => 'food', 'is_active' => true]);

        Category::create(['name' => 'Business', 'slug' => 'business', 'is_active' => true, 'sort_order' => 3]);
        Category::create(['name' => 'Culture', 'slug' => 'culture', 'is_active' => true, 'sort_order' => 4]);
    }
}
