新增游戏管理系统:①game_configs表+模型(forGame/isEnabled/param静态方法) ②GameConfigSeeder初始化5款游戏参数 ③后台卡片式管理页(开关+参数表单) ④侧边栏菜单「游戏管理」

This commit is contained in:
2026-03-01 20:17:18 +08:00
parent 8c99e1fad7
commit 8a74bfd639
7 changed files with 585 additions and 0 deletions
@@ -0,0 +1,40 @@
<?php
/**
* 文件功能:游戏配置表迁移
*
* 集中管理聊天室所有娱乐游戏的开关状态和核心参数。
* 每个游戏对应一行记录,params 字段存储各游戏的 JSON 参数。
*/
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* 创建 game_configs 表。
*/
public function up(): void
{
Schema::create('game_configs', function (Blueprint $table) {
$table->id();
$table->string('game_key', 50)->unique()->comment('游戏唯一标识(如 baccarat、slot_machine');
$table->string('name', 100)->comment('游戏中文名');
$table->string('icon', 10)->default('🎮')->comment('游戏图标 Emoji');
$table->text('description')->nullable()->comment('游戏简介');
$table->boolean('enabled')->default(false)->comment('是否开启');
$table->json('params')->nullable()->comment('游戏核心参数(JSON');
$table->timestamps();
});
}
/**
* 回滚迁移。
*/
public function down(): void
{
Schema::dropIfExists('game_configs');
}
};