<?php

namespace Database\Seeders;

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

class MenuSeeder extends Seeder
{
    /**
     * Run the database seeds.
     */
    public function run(): void
    {
        $now = now();

        // Insert parent menu first
        $aboutId = Menu::insertGetId([
            'name' => 'About',
            'slug' => 'about',
            'parent_id' => null,
            'display_order' => 2,
            'is_visible' => true,
            'requires_auth' => false,
            'created_at' => $now,
            'updated_at' => $now,
        ]);

        // Bulk insert remaining menus
        Menu::insert([
            [
                'name' => 'Success Stories',
                'slug' => 'about/success-stories',
                'parent_id' => $aboutId,
                'display_order' => 2,
                'is_visible' => true,
                'requires_auth' => false,
                'created_at' => $now,
                'updated_at' => $now,
            ],
            [
                'name' => 'My Account',
                'slug' => 'account',
                'parent_id' => null,
                'display_order' => 5,
                'is_visible' => true,
                'requires_auth' => true,
                'created_at' => $now,
                'updated_at' => $now,
            ],
        ]);
    }
}
