Files
laravel_swoole/database/seeders/SystemSeeder.php
2026-02-19 10:39:38 +08:00

901 lines
33 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?php
namespace Database\Seeders;
use App\Models\System\Config;
use App\Models\System\Dictionary;
use App\Models\System\DictionaryItem;
use App\Models\Auth\Permission;
use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\DB;
class SystemSeeder extends Seeder
{
/**
* Run the database seeds.
*/
public function run(): void
{
// SQLite 不支持 SET FOREIGN_KEY_CHECKS使用 PRAGMA
if (DB::getDriverName() === 'sqlite') {
DB::statement('PRAGMA foreign_keys = OFF;');
} else {
DB::statement('SET FOREIGN_KEY_CHECKS=0;');
}
// 清空表数据
DictionaryItem::truncate();
Dictionary::truncate();
Config::truncate();
$this->createSystemPermissions();
$this->createSystemDictionaries();
$this->createSystemConfigs();
$this->command->info('System module data seeded successfully!');
// 恢复外键约束
if (DB::getDriverName() === 'sqlite') {
DB::statement('PRAGMA foreign_keys = ON;');
} else {
DB::statement('SET FOREIGN_KEY_CHECKS=1;');
}
}
/**
* 创建系统管理权限节点
*/
private function createSystemPermissions(): void
{
$permissions = [
// 系统顶级菜单
[
'title' => '系统',
'name' => 'system',
'type' => 'menu',
'parent_id' => 0,
'path' => '/system',
'component' => null,
'meta' => json_encode([
'icon' => 'Setting',
'hidden' => false,
'hiddenBreadcrumb' => false,
]),
'sort' => 3,
'status' => 1,
],
// 系统配置
[
'title' => '系统配置',
'name' => 'system.setting',
'type' => 'menu',
'parent_id' => 0, // 稍后更新为系统菜单的ID
'path' => '/system/setting',
'component' => 'system/setting/index',
'meta' => json_encode([
'icon' => 'SettingFilled',
'hidden' => false,
'hiddenBreadcrumb' => false,
]),
'sort' => 1,
'status' => 1,
],
[
'title' => '查看配置',
'name' => 'system.setting.view',
'type' => 'button',
'parent_id' => 0, // 稍后更新为系统配置菜单的ID
'path' => 'admin.setting.index',
'component' => null,
'meta' => null,
'sort' => 1,
'status' => 1,
],
[
'title' => '创建配置',
'name' => 'system.setting.create',
'type' => 'button',
'parent_id' => 0, // 稍后更新为系统配置菜单的ID
'path' => 'admin.setting.store',
'component' => null,
'meta' => null,
'sort' => 2,
'status' => 1,
],
[
'title' => '编辑配置',
'name' => 'system.setting.update',
'type' => 'button',
'parent_id' => 0, // 稍后更新为系统配置菜单的ID
'path' => 'admin.setting.update',
'component' => null,
'meta' => null,
'sort' => 3,
'status' => 1,
],
[
'title' => '删除配置',
'name' => 'system.setting.delete',
'type' => 'button',
'parent_id' => 0, // 稍后更新为系统配置菜单的ID
'path' => 'admin.setting.destroy',
'component' => null,
'meta' => null,
'sort' => 4,
'status' => 1,
],
[
'title' => '批量删除配置',
'name' => 'system.setting.batch-delete',
'type' => 'button',
'parent_id' => 0, // 稍后更新为系统配置菜单的ID
'path' => 'admin.setting.batch-delete',
'component' => null,
'meta' => null,
'sort' => 5,
'status' => 1,
],
// 系统日志
[
'title' => '系统日志',
'name' => 'system.log',
'type' => 'menu',
'parent_id' => 0, // 稍后更新为系统菜单的ID
'path' => '/system/log',
'component' => 'system/log/index',
'meta' => json_encode([
'icon' => 'DocumentCopy',
'hidden' => false,
'hiddenBreadcrumb' => false,
]),
'sort' => 2,
'status' => 1,
],
[
'title' => '查看日志',
'name' => 'system.log.view',
'type' => 'button',
'parent_id' => 0, // 稍后更新为系统日志菜单的ID
'path' => 'admin.log.index',
'component' => null,
'meta' => null,
'sort' => 1,
'status' => 1,
],
[
'title' => '删除日志',
'name' => 'system.log.delete',
'type' => 'button',
'parent_id' => 0, // 稍后更新为系统日志菜单的ID
'path' => 'admin.log.destroy',
'component' => null,
'meta' => null,
'sort' => 2,
'status' => 1,
],
[
'title' => '批量删除日志',
'name' => 'system.log.batch-delete',
'type' => 'button',
'parent_id' => 0, // 稍后更新为系统日志菜单的ID
'path' => 'admin.log.batch-delete',
'component' => null,
'meta' => null,
'sort' => 3,
'status' => 1,
],
[
'title' => '导出日志',
'name' => 'system.log.export',
'type' => 'button',
'parent_id' => 0, // 稍后更新为系统日志菜单的ID
'path' => 'admin.log.export',
'component' => null,
'meta' => null,
'sort' => 4,
'status' => 1,
],
// 数据字典
[
'title' => '数据字典',
'name' => 'system.dictionary',
'type' => 'menu',
'parent_id' => 0, // 稍后更新为系统菜单的ID
'path' => '/system/dictionary',
'component' => 'system/dictionary/index',
'meta' => json_encode([
'icon' => 'Notebook',
'hidden' => false,
'hiddenBreadcrumb' => false,
]),
'sort' => 3,
'status' => 1,
],
[
'title' => '查看字典',
'name' => 'system.dictionary.view',
'type' => 'button',
'parent_id' => 0, // 稍后更新为数据字典菜单的ID
'path' => 'admin.dictionary.index',
'component' => null,
'meta' => null,
'sort' => 1,
'status' => 1,
],
[
'title' => '创建字典',
'name' => 'system.dictionary.create',
'type' => 'button',
'parent_id' => 0, // 稍后更新为数据字典菜单的ID
'path' => 'admin.dictionary.store',
'component' => null,
'meta' => null,
'sort' => 2,
'status' => 1,
],
[
'title' => '编辑字典',
'name' => 'system.dictionary.update',
'type' => 'button',
'parent_id' => 0, // 稍后更新为数据字典菜单的ID
'path' => 'admin.dictionary.update',
'component' => null,
'meta' => null,
'sort' => 3,
'status' => 1,
],
[
'title' => '删除字典',
'name' => 'system.dictionary.delete',
'type' => 'button',
'parent_id' => 0, // 稍后更新为数据字典菜单的ID
'path' => 'admin.dictionary.destroy',
'component' => null,
'meta' => null,
'sort' => 4,
'status' => 1,
],
[
'title' => '批量删除字典',
'name' => 'system.dictionary.batch-delete',
'type' => 'button',
'parent_id' => 0, // 稍后更新为数据字典菜单的ID
'path' => 'admin.dictionary.batch-delete',
'component' => null,
'meta' => null,
'sort' => 5,
'status' => 1,
],
// 定时任务
[
'title' => '定时任务',
'name' => 'system.task',
'type' => 'menu',
'parent_id' => 0, // 稍后更新为系统菜单的ID
'path' => '/system/task',
'component' => 'system/task/index',
'meta' => json_encode([
'icon' => 'Timer',
'hidden' => false,
'hiddenBreadcrumb' => false,
]),
'sort' => 4,
'status' => 1,
],
[
'title' => '查看任务',
'name' => 'system.task.view',
'type' => 'button',
'parent_id' => 0, // 稍后更新为定时任务菜单的ID
'path' => 'admin.task.index',
'component' => null,
'meta' => null,
'sort' => 1,
'status' => 1,
],
[
'title' => '创建任务',
'name' => 'system.task.create',
'type' => 'button',
'parent_id' => 0, // 稍后更新为定时任务菜单的ID
'path' => 'admin.task.store',
'component' => null,
'meta' => null,
'sort' => 2,
'status' => 1,
],
[
'title' => '编辑任务',
'name' => 'system.task.update',
'type' => 'button',
'parent_id' => 0, // 稍后更新为定时任务菜单的ID
'path' => 'admin.task.update',
'component' => null,
'meta' => null,
'sort' => 3,
'status' => 1,
],
[
'title' => '删除任务',
'name' => 'system.task.delete',
'type' => 'button',
'parent_id' => 0, // 稍后更新为定时任务菜单的ID
'path' => 'admin.task.destroy',
'component' => null,
'meta' => null,
'sort' => 4,
'status' => 1,
],
[
'title' => '批量删除任务',
'name' => 'system.task.batch-delete',
'type' => 'button',
'parent_id' => 0, // 稍后更新为定时任务菜单的ID
'path' => 'admin.task.batch-delete',
'component' => null,
'meta' => null,
'sort' => 5,
'status' => 1,
],
[
'title' => '执行任务',
'name' => 'system.task.execute',
'type' => 'button',
'parent_id' => 0, // 稍后更新为定时任务菜单的ID
'path' => 'admin.task.execute',
'component' => null,
'meta' => null,
'sort' => 6,
'status' => 1,
],
[
'title' => '启用任务',
'name' => 'system.task.enable',
'type' => 'button',
'parent_id' => 0, // 稍后更新为定时任务菜单的ID
'path' => 'admin.task.enable',
'component' => null,
'meta' => null,
'sort' => 7,
'status' => 1,
],
[
'title' => '禁用任务',
'name' => 'system.task.disable',
'type' => 'button',
'parent_id' => 0, // 稍后更新为定时任务菜单的ID
'path' => 'admin.task.disable',
'component' => null,
'meta' => null,
'sort' => 8,
'status' => 1,
],
// 城市管理
[
'title' => '城市管理',
'name' => 'system.city',
'type' => 'menu',
'parent_id' => 0, // 稍后更新为系统菜单的ID
'path' => '/system/city',
'component' => 'system/city/index',
'meta' => json_encode([
'icon' => 'EnvironmentOutlined',
'hidden' => false,
'hiddenBreadcrumb' => false,
]),
'sort' => 5,
'status' => 1,
],
[
'title' => '查看城市',
'name' => 'system.city.view',
'type' => 'button',
'parent_id' => 0, // 稍后更新为城市管理菜单的ID
'path' => 'admin.city.index',
'component' => null,
'meta' => null,
'sort' => 1,
'status' => 1,
],
[
'title' => '创建城市',
'name' => 'system.city.create',
'type' => 'button',
'parent_id' => 0, // 稍后更新为城市管理菜单的ID
'path' => 'admin.city.store',
'component' => null,
'meta' => null,
'sort' => 2,
'status' => 1,
],
[
'title' => '编辑城市',
'name' => 'system.city.update',
'type' => 'button',
'parent_id' => 0, // 稍后更新为城市管理菜单的ID
'path' => 'admin.city.update',
'component' => null,
'meta' => null,
'sort' => 3,
'status' => 1,
],
[
'title' => '删除城市',
'name' => 'system.city.delete',
'type' => 'button',
'parent_id' => 0, // 稍后更新为城市管理菜单的ID
'path' => 'admin.city.destroy',
'component' => null,
'meta' => null,
'sort' => 4,
'status' => 1,
],
[
'title' => '批量删除城市',
'name' => 'system.city.batch-delete',
'type' => 'button',
'parent_id' => 0, // 稍后更新为城市管理菜单的ID
'path' => 'admin.city.batch-delete',
'component' => null,
'meta' => null,
'sort' => 5,
'status' => 1,
],
];
foreach ($permissions as $permission) {
Permission::create($permission);
}
// 更新parent_id
$this->updateParentIds();
}
/**
* 更新parent_id建立层级关系
*/
private function updateParentIds(): void
{
$permissions = Permission::all();
// 获取系统顶级菜单ID
$systemMenu = $permissions->where('name', 'system')->first();
// 获取系统子菜单ID
$settingMenu = $permissions->where('name', 'system.setting')->first();
$logMenu = $permissions->where('name', 'system.log')->first();
$dictionaryMenu = $permissions->where('name', 'system.dictionary')->first();
$taskMenu = $permissions->where('name', 'system.task')->first();
$cityMenu = $permissions->where('name', 'system.city')->first();
// 更新系统子菜单的parent_id
if ($systemMenu) {
if ($settingMenu) {
$settingMenu->update(['parent_id' => $systemMenu->id]);
}
if ($logMenu) {
$logMenu->update(['parent_id' => $systemMenu->id]);
}
if ($dictionaryMenu) {
$dictionaryMenu->update(['parent_id' => $systemMenu->id]);
}
if ($taskMenu) {
$taskMenu->update(['parent_id' => $systemMenu->id]);
}
if ($cityMenu) {
$cityMenu->update(['parent_id' => $systemMenu->id]);
}
}
// 更新按钮权限的parent_id - 系统配置
$settingViewBtn = $permissions->where('name', 'system.setting.view')->first();
$settingCreateBtn = $permissions->where('name', 'system.setting.create')->first();
$settingUpdateBtn = $permissions->where('name', 'system.setting.update')->first();
$settingDeleteBtn = $permissions->where('name', 'system.setting.delete')->first();
$settingBatchDeleteBtn = $permissions->where('name', 'system.setting.batch-delete')->first();
if ($settingMenu) {
if ($settingViewBtn) {
$settingViewBtn->update(['parent_id' => $settingMenu->id]);
}
if ($settingCreateBtn) {
$settingCreateBtn->update(['parent_id' => $settingMenu->id]);
}
if ($settingUpdateBtn) {
$settingUpdateBtn->update(['parent_id' => $settingMenu->id]);
}
if ($settingDeleteBtn) {
$settingDeleteBtn->update(['parent_id' => $settingMenu->id]);
}
if ($settingBatchDeleteBtn) {
$settingBatchDeleteBtn->update(['parent_id' => $settingMenu->id]);
}
}
// 更新按钮权限的parent_id - 系统日志
$logViewBtn = $permissions->where('name', 'system.log.view')->first();
$logDeleteBtn = $permissions->where('name', 'system.log.delete')->first();
$logBatchDeleteBtn = $permissions->where('name', 'system.log.batch-delete')->first();
$logExportBtn = $permissions->where('name', 'system.log.export')->first();
if ($logMenu) {
if ($logViewBtn) {
$logViewBtn->update(['parent_id' => $logMenu->id]);
}
if ($logDeleteBtn) {
$logDeleteBtn->update(['parent_id' => $logMenu->id]);
}
if ($logBatchDeleteBtn) {
$logBatchDeleteBtn->update(['parent_id' => $logMenu->id]);
}
if ($logExportBtn) {
$logExportBtn->update(['parent_id' => $logMenu->id]);
}
}
// 更新按钮权限的parent_id - 数据字典
$dictViewBtn = $permissions->where('name', 'system.dictionary.view')->first();
$dictCreateBtn = $permissions->where('name', 'system.dictionary.create')->first();
$dictUpdateBtn = $permissions->where('name', 'system.dictionary.update')->first();
$dictDeleteBtn = $permissions->where('name', 'system.dictionary.delete')->first();
$dictBatchDeleteBtn = $permissions->where('name', 'system.dictionary.batch-delete')->first();
if ($dictionaryMenu) {
if ($dictViewBtn) {
$dictViewBtn->update(['parent_id' => $dictionaryMenu->id]);
}
if ($dictCreateBtn) {
$dictCreateBtn->update(['parent_id' => $dictionaryMenu->id]);
}
if ($dictUpdateBtn) {
$dictUpdateBtn->update(['parent_id' => $dictionaryMenu->id]);
}
if ($dictDeleteBtn) {
$dictDeleteBtn->update(['parent_id' => $dictionaryMenu->id]);
}
if ($dictBatchDeleteBtn) {
$dictBatchDeleteBtn->update(['parent_id' => $dictionaryMenu->id]);
}
}
// 更新按钮权限的parent_id - 定时任务
$taskViewBtn = $permissions->where('name', 'system.task.view')->first();
$taskCreateBtn = $permissions->where('name', 'system.task.create')->first();
$taskUpdateBtn = $permissions->where('name', 'system.task.update')->first();
$taskDeleteBtn = $permissions->where('name', 'system.task.delete')->first();
$taskBatchDeleteBtn = $permissions->where('name', 'system.task.batch-delete')->first();
$taskExecuteBtn = $permissions->where('name', 'system.task.execute')->first();
$taskEnableBtn = $permissions->where('name', 'system.task.enable')->first();
$taskDisableBtn = $permissions->where('name', 'system.task.disable')->first();
if ($taskMenu) {
if ($taskViewBtn) {
$taskViewBtn->update(['parent_id' => $taskMenu->id]);
}
if ($taskCreateBtn) {
$taskCreateBtn->update(['parent_id' => $taskMenu->id]);
}
if ($taskUpdateBtn) {
$taskUpdateBtn->update(['parent_id' => $taskMenu->id]);
}
if ($taskDeleteBtn) {
$taskDeleteBtn->update(['parent_id' => $taskMenu->id]);
}
if ($taskBatchDeleteBtn) {
$taskBatchDeleteBtn->update(['parent_id' => $taskMenu->id]);
}
if ($taskExecuteBtn) {
$taskExecuteBtn->update(['parent_id' => $taskMenu->id]);
}
if ($taskEnableBtn) {
$taskEnableBtn->update(['parent_id' => $taskMenu->id]);
}
if ($taskDisableBtn) {
$taskDisableBtn->update(['parent_id' => $taskMenu->id]);
}
}
// 更新按钮权限的parent_id - 城市管理
$cityViewBtn = $permissions->where('name', 'system.city.view')->first();
$cityCreateBtn = $permissions->where('name', 'system.city.create')->first();
$cityUpdateBtn = $permissions->where('name', 'system.city.update')->first();
$cityDeleteBtn = $permissions->where('name', 'system.city.delete')->first();
$cityBatchDeleteBtn = $permissions->where('name', 'system.city.batch-delete')->first();
if ($cityMenu) {
if ($cityViewBtn) {
$cityViewBtn->update(['parent_id' => $cityMenu->id]);
}
if ($cityCreateBtn) {
$cityCreateBtn->update(['parent_id' => $cityMenu->id]);
}
if ($cityUpdateBtn) {
$cityUpdateBtn->update(['parent_id' => $cityMenu->id]);
}
if ($cityDeleteBtn) {
$cityDeleteBtn->update(['parent_id' => $cityMenu->id]);
}
if ($cityBatchDeleteBtn) {
$cityBatchDeleteBtn->update(['parent_id' => $cityMenu->id]);
}
}
}
/**
* 创建系统字典
*/
private function createSystemDictionaries(): void
{
// 创建字典类型
$dictionary = [
[
'name' => '用户状态',
'code' => 'user_status',
'description' => '用户账号状态',
'value_type' => 'number',
'sort' => 1,
'status' => 1,
],
[
'name' => '性别',
'code' => 'gender',
'description' => '用户性别',
'value_type' => 'number',
'sort' => 2,
'status' => 1,
],
[
'name' => '角色状态',
'code' => 'role_status',
'description' => '角色启用状态',
'value_type' => 'number',
'sort' => 3,
'status' => 1,
],
[
'name' => '字典状态',
'code' => 'dictionary_status',
'description' => '数据字典状态',
'value_type' => 'number',
'sort' => 4,
'status' => 1,
],
[
'name' => '任务状态',
'code' => 'task_status',
'description' => '定时任务状态',
'value_type' => 'number',
'sort' => 5,
'status' => 1,
],
[
'name' => '日志类型',
'code' => 'log_type',
'description' => '系统日志类型',
'value_type' => 'string',
'sort' => 6,
'status' => 1,
],
[
'name' => '是否',
'code' => 'yes_no',
'description' => '是否选项',
'value_type' => 'boolean',
'sort' => 7,
'status' => 1,
],
[
'name' => '配置分组',
'code' => 'config_group',
'description' => '系统配置分组类型',
'value_type' => 'string',
'sort' => 8,
'status' => 1,
],
];
foreach ($dictionary as $dictionary) {
$dict = Dictionary::create($dictionary);
$this->createDictionaryItems($dict);
}
}
/**
* 创建字典项
*/
private function createDictionaryItems(Dictionary $dictionary): void
{
$items = [];
switch ($dictionary->code) {
case 'user_status':
$items = [
['label' => '正常', 'value' => 1, 'sort' => 1, 'status' => 1],
['label' => '禁用', 'value' => 0, 'sort' => 2, 'status' => 1],
];
break;
case 'gender':
$items = [
['label' => '男', 'value' => 1, 'sort' => 1, 'status' => 1],
['label' => '女', 'value' => 2, 'sort' => 2, 'status' => 1],
['label' => '保密', 'value' => 0, 'sort' => 3, 'status' => 1],
];
break;
case 'role_status':
$items = [
['label' => '启用', 'value' => 1, 'sort' => 1, 'status' => 1],
['label' => '禁用', 'value' => 0, 'sort' => 2, 'status' => 1],
];
break;
case 'dictionary_status':
$items = [
['label' => '启用', 'value' => 1, 'sort' => 1, 'status' => 1],
['label' => '禁用', 'value' => 0, 'sort' => 2, 'status' => 1],
];
break;
case 'task_status':
$items = [
['label' => '待执行', 'value' => 0, 'sort' => 1, 'status' => 1],
['label' => '执行中', 'value' => 1, 'sort' => 2, 'status' => 1],
['label' => '已完成', 'value' => 2, 'sort' => 3, 'status' => 1],
['label' => '失败', 'value' => 3, 'sort' => 4, 'status' => 1],
];
break;
case 'log_type':
$items = [
['label' => '登录日志', 'value' => 'login', 'sort' => 1, 'status' => 1],
['label' => '操作日志', 'value' => 'operation', 'sort' => 2, 'status' => 1],
['label' => '异常日志', 'value' => 'error', 'sort' => 3, 'status' => 1],
['label' => '系统日志', 'value' => 'system', 'sort' => 4, 'status' => 1],
];
break;
case 'yes_no':
$items = [
['label' => '是', 'value' => 1, 'sort' => 1, 'status' => 1],
['label' => '否', 'value' => 0, 'sort' => 2, 'status' => 1],
];
break;
case 'config_group':
$items = [
['label' => '网站设置', 'value' => 'site', 'sort' => 1, 'status' => 1],
['label' => '上传设置', 'value' => 'upload', 'sort' => 2, 'status' => 1],
['label' => '系统设置', 'value' => 'system', 'sort' => 3, 'status' => 1],
];
break;
}
foreach ($items as $item) {
$dictionary->items()->create($item);
}
}
/**
* 创建系统配置
*/
private function createSystemConfigs(): void
{
$configs = [
[
'group' => 'site',
'key' => 'site_name',
'name' => '网站名称',
'value' => 'Laravel Swoole 管理系统',
'type' => 'string',
'description' => '系统显示的网站名称',
'sort' => 1,
'is_system' => true,
'status' => 1,
],
[
'group' => 'site',
'key' => 'site_logo',
'name' => '网站Logo',
'value' => '',
'type' => 'file',
'description' => '系统Logo图片地址',
'sort' => 2,
'is_system' => true,
'status' => 1,
],
[
'group' => 'site',
'key' => 'site_copyright',
'name' => '版权信息',
'value' => '© 2024 Laravel Swoole Admin',
'type' => 'string',
'description' => '网站底部版权信息',
'sort' => 3,
'is_system' => true,
'status' => 1,
],
[
'group' => 'site',
'key' => 'site_icp',
'name' => '备案号',
'value' => '',
'type' => 'string',
'description' => '网站备案号',
'sort' => 4,
'is_system' => true,
'status' => 1,
],
[
'group' => 'upload',
'key' => 'upload_max_size',
'name' => '上传最大限制',
'value' => '10',
'type' => 'number',
'description' => '文件上传最大限制MB',
'sort' => 1,
'is_system' => true,
'status' => 1,
],
[
'group' => 'upload',
'key' => 'upload_allowed_types',
'name' => '允许上传类型',
'value' => 'jpg,jpeg,png,gif,pdf,doc,docx,xls,xlsx',
'type' => 'string',
'description' => '允许上传的文件扩展名',
'sort' => 2,
'is_system' => true,
'status' => 1,
],
[
'group' => 'system',
'key' => 'user_default_avatar',
'name' => '默认头像',
'value' => '',
'type' => 'file',
'description' => '用户默认头像地址',
'sort' => 1,
'is_system' => true,
'status' => 1,
],
[
'group' => 'system',
'key' => 'system_timezone',
'name' => '系统时区',
'value' => 'Asia/Shanghai',
'type' => 'string',
'description' => '系统默认时区',
'sort' => 2,
'is_system' => true,
'status' => 1,
],
[
'group' => 'system',
'key' => 'system_language',
'name' => '系统语言',
'value' => 'zh-CN',
'type' => 'string',
'description' => '系统默认语言',
'sort' => 3,
'is_system' => true,
'status' => 1,
],
[
'group' => 'system',
'key' => 'enable_register',
'name' => '开启注册',
'value' => '1',
'type' => 'boolean',
'description' => '是否开启用户注册功能',
'sort' => 4,
'is_system' => true,
'status' => 1,
],
];
foreach ($configs as $config) {
Config::create($config);
}
}
}