<?php

namespace Database\Seeders;

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

class ConfigGroupSeeder extends Seeder
{
    public function run(): void
    {
        $groups = [
            ['name' => '基础配置', 'code' => 'basic', 'sort' => 0],
            ['name' => '上传配置', 'code' => 'upload', 'sort' => 1],
            ['name' => '安全配置', 'code' => 'security', 'sort' => 2],
        ];

        foreach ($groups as $group) {
            ConfigGroup::updateOrCreate(
                ['code' => $group['code']],
                [
                    'name' => $group['name'],
                    'sort' => $group['sort'],
                    'status' => 1,
                ]
            );
        }
    }
}
