🔧 Changing configuration files.

This commit is contained in:
Wisp X
2022-02-14 11:36:19 +08:00
parent 39238a61d7
commit 11857bbe9d
13 changed files with 159 additions and 246 deletions
@@ -46,7 +46,7 @@ class GroupController extends Controller
$group = new Group([
'id' => 0,
'name' => '系统默认组',
'configs' => Utils::config(ConfigKey::GroupConfigs),
'configs' => Utils::config(ConfigKey::Group),
]);
} else {
$group = Group::query()->findOrFail($request->route('id'));
@@ -66,7 +66,7 @@ class GroupController extends Controller
{
if ($request->route('id') == 0) {
$configs = Utils::parseConfigs(Group::getDefaultConfigs()->toArray(), $request->validated('configs'));
if (! Config::query()->where('name', ConfigKey::GroupConfigs)->update([
if (! Config::query()->where('name', ConfigKey::Group)->update([
'value' => collect($configs)->toJson(),
])) {
return $this->error('保存失败');