setting seeder

main
panliang 2024-04-19 17:08:11 +08:00
parent 709dbeea57
commit c6caa1f2dd
1 changed files with 5 additions and 3 deletions

View File

@ -17,13 +17,15 @@ class SettingSeeder extends Seeder
DB::table('admin_settings')->truncate();
$now = now();
$list = [
['key' => 'upload_disk', 'values' => 'public', 'created_at' => $now, 'updated_at' => $now],
['key' => 'sign', 'values' => json_encode(['distance' => '10']), 'created_at' => $now, 'updated_at' => $now],
['key' => 'upload_disk', 'values' => 'public'],
['key' => 'sign', 'values' => json_encode(['distance' => '10'])],
['key' => 'baidu', 'values' => json_encode(['js_key' => '62038330xDTLJ15QG6zt3f6VQcaNBfN8q3MsWBsE'])]
];
// 清空缓存
foreach ($list as $item) {
foreach ($list as &$item) {
AdminSettingService::make()->clearCache($item['key']);
$item['created_at'] = $now;
$item['updated_at'] = $now;
}
DB::table('admin_settings')->insert($list);
}