<?php

namespace Database\Seeders;

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

class SysParamSeeder extends Seeder
{
    /**
     * Run the database seeds.
     */
    public function run(): void
    {
        $params = [
            ['alias' => 'sys_name', 'guidetxt' => '聊天室名称', 'body' => '飘落的流星在线聊天'],
            ['alias' => 'max_people', 'guidetxt' => '最大人数限制', 'body' => '500'],
            ['alias' => 'welcome_msg', 'guidetxt' => '欢迎信息', 'body' => '欢迎来到飘落的流星在线聊天室！'],
            ['alias' => 'sys_notice', 'guidetxt' => '系统公告', 'body' => '系统重构中，体验Laravel 12 + Reverb全新架构。'],
            ['alias' => 'name_length', 'guidetxt' => '用户名最大长度', 'body' => '10'],
            ['alias' => 'say_length', 'guidetxt' => '发言最大长度', 'body' => '250'],
        ];

        foreach ($params as $param) {
            SysParam::updateOrCreate(
                ['alias' => $param['alias']],
                $param
            );
        }
    }
}
