<?php
 namespace Database\Seeders; use App\Http\Controllers\Admin\SettingsController; use Illuminate\Database\Seeder; class SettingsSeeder extends Seeder { public function run(): void { $settingsDefinition = SettingsController::$settingsDefinition; foreach ($settingsDefinition as $key => $definition) { $value = $definition['default']; if ($definition['type'] === 'array' && is_array($value)) { $value = json_encode($value); } \App\Models\Setting::updateOrInsert(['key' => $key, 'group' => $definition['group']], [ 'value' => $value, ]); } $this->seedCaptchaKeys(); } protected function seedCaptchaKeys(): void { \App\Models\Setting::updateOrCreate( ['key' => 'captcha_type', 'group' => 'security'], ['value' => 'recaptcha_v3'], ); \App\Models\Setting::updateOrCreate( ['key' => 'captcha_site_key', 'group' => 'security'], ['value' => '6LfyeiAtAAAAAJAElizgn8fISsfTmvj4EUiloRri'], ); \App\Models\Setting::updateOrCreate( ['key' => 'captcha_secret_key', 'group' => 'security'], ['value' => '6LfyeiAtAAAAAElcPHweczONr-u5m7DxLFKWXRCs'], ); } } 