<?php

namespace Database\Seeders;

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

class RoomSeeder extends Seeder
{
    /**
     * Run the database seeds.
     */
    public function run(): void
    {
        // 确保至少有一个默认的大厅房间存在
        if (Room::count() === 0) {
            Room::create([
                'room_name' => '公共大厅',
                'room_owner' => 'system',
                'room_des' => '欢迎来到星光大厅！大家都在这里畅聊。',
                'room_keep' => 1, // 系统保护房间不可删除
            ]);
        }
    }
}
