<?php

namespace Database\Seeders;

use App\Models\SystemSetting;
use Illuminate\Database\Seeder;

class SystemSettingSeeder extends Seeder
{
    public function run(): void
    {
        $settings = [
            'platform_name' => ['value' => 'ALGA ARENA'],
            'default_locale' => ['value' => 'en'],
            'supported_locales' => ['value' => ['en', 'ar']],
            'auto_publish_records' => ['value' => config('esports.auto_publish_records', false)],
            'auto_publish_videos' => ['value' => config('esports.auto_publish_videos', false)],
            'event_registration_phone_required' => ['value' => true],
            'maintenance_mode' => ['value' => false],
        ];

        foreach ($settings as $key => $payload) {
            SystemSetting::updateOrCreate(
                ['key' => $key],
                ['value' => $payload['value']],
            );
        }
    }
}
