<?php

namespace Database\Seeders;

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

class SettingSeeder extends Seeder
{
    /**
     * Run the database seeds.
     */
    public function run(): void
    {
        $settings = [
            // General Settings
            ['key' => 'site_name', 'value' => '360Monica', 'value_km' => '360Monica', 'type' => 'text', 'group' => 'general', 'label' => 'Site Name', 'description' => 'The name of your website', 'order' => 1],
            ['key' => 'site_tagline', 'value' => 'Your Premium Shopping Destination', 'value_km' => 'គោលដៅទិញឥវ៉ាន់ដ៏ល្អបំផុតរបស់អ្នក', 'type' => 'text', 'group' => 'general', 'label' => 'Site Tagline', 'description' => 'A short tagline for your website', 'order' => 2],
            ['key' => 'site_logo', 'value' => null, 'value_km' => null, 'type' => 'image', 'group' => 'general', 'label' => 'Site Logo', 'description' => 'Upload your site logo', 'order' => 3],
            ['key' => 'favicon', 'value' => null, 'value_km' => null, 'type' => 'image', 'group' => 'general', 'label' => 'Favicon', 'description' => 'Upload your favicon (16x16 or 32x32 pixels)', 'order' => 4],
            ['key' => 'default_language', 'value' => 'km', 'value_km' => 'km', 'type' => 'text', 'group' => 'general', 'label' => 'Default Language', 'description' => 'Default language for the website', 'order' => 5],
            ['key' => 'timezone', 'value' => 'Asia/Phnom_Penh', 'value_km' => 'Asia/Phnom_Penh', 'type' => 'text', 'group' => 'general', 'label' => 'Timezone', 'description' => 'Website timezone', 'order' => 6],
            ['key' => 'currency', 'value' => 'USD', 'value_km' => 'USD', 'type' => 'text', 'group' => 'general', 'label' => 'Currency', 'description' => 'Default currency code', 'order' => 7],
            ['key' => 'currency_symbol', 'value' => '$', 'value_km' => '$', 'type' => 'text', 'group' => 'general', 'label' => 'Currency Symbol', 'description' => 'Currency symbol to display', 'order' => 8],
            ['key' => 'currency_position', 'value' => 'before', 'value_km' => 'before', 'type' => 'text', 'group' => 'general', 'label' => 'Currency Position', 'description' => 'Position of currency symbol (before/after)', 'order' => 9],

            // Contact Information
            ['key' => 'company_name', 'value' => '360Monica', 'value_km' => '360Monica', 'type' => 'text', 'group' => 'contact', 'label' => 'Company Name', 'description' => 'Your company name', 'order' => 1],
            ['key' => 'contact_email', 'value' => 'contact@360monica.com', 'value_km' => 'contact@360monica.com', 'type' => 'email', 'group' => 'contact', 'label' => 'Contact Email', 'description' => 'Main contact email address', 'order' => 2],
            ['key' => 'support_email', 'value' => 'support@360monica.com', 'value_km' => 'support@360monica.com', 'type' => 'email', 'group' => 'contact', 'label' => 'Support Email', 'description' => 'Customer support email', 'order' => 3],
            ['key' => 'sales_email', 'value' => 'sales@360monica.com', 'value_km' => 'sales@360monica.com', 'type' => 'email', 'group' => 'contact', 'label' => 'Sales Email', 'description' => 'Sales inquiries email', 'order' => 4],
            ['key' => 'primary_phone', 'value' => '+855 12 345 678', 'value_km' => '+855 12 345 678', 'type' => 'text', 'group' => 'contact', 'label' => 'Primary Phone', 'description' => 'Main contact phone number', 'order' => 5],
            ['key' => 'support_phone', 'value' => '+855 12 345 679', 'value_km' => '+855 12 345 679', 'type' => 'text', 'group' => 'contact', 'label' => 'Support Phone', 'description' => 'Customer support phone', 'order' => 6],
            ['key' => 'whatsapp_number', 'value' => '+855 12 345 678', 'value_km' => '+855 12 345 678', 'type' => 'text', 'group' => 'contact', 'label' => 'WhatsApp Number', 'description' => 'WhatsApp contact number', 'order' => 7],
            ['key' => 'address_street', 'value' => '123 Main Street', 'value_km' => '123 Main Street', 'type' => 'text', 'group' => 'contact', 'label' => 'Street Address', 'description' => 'Street address', 'order' => 8],
            ['key' => 'address_city', 'value' => 'Phnom Penh', 'value_km' => 'ភ្នំពេញ', 'type' => 'text', 'group' => 'contact', 'label' => 'City', 'description' => 'City name', 'order' => 9],
            ['key' => 'address_state', 'value' => 'Phnom Penh', 'value_km' => 'ភ្នំពេញ', 'type' => 'text', 'group' => 'contact', 'label' => 'State/Province', 'description' => 'State or province', 'order' => 10],
            ['key' => 'address_country', 'value' => 'Cambodia', 'value_km' => 'កម្ពុជា', 'type' => 'text', 'group' => 'contact', 'label' => 'Country', 'description' => 'Country name', 'order' => 11],
            ['key' => 'address_postal', 'value' => '12000', 'value_km' => '12000', 'type' => 'text', 'group' => 'contact', 'label' => 'Postal Code', 'description' => 'Postal/ZIP code', 'order' => 12],

            // About Settings
            ['key' => 'about_title', 'value' => 'About Us', 'value_km' => 'អំពីយើង', 'type' => 'text', 'group' => 'about', 'label' => 'About Title', 'description' => 'Main title for the about page', 'order' => 1],
            ['key' => 'about_content', 'value' => 'Welcome to 360Monica, your trusted partner for premium products and exceptional service.', 'value_km' => 'សូមស្វាគមន៍មកកាន់ 360Monica ដែលជាដៃគូដែលអាចទុកចិត្តបានសម្រាប់ផលិតផលដ៏ល្អបំផុត និងសេវាកម្មដ៏ល្អឥតខ្ចោះ។', 'type' => 'textarea', 'group' => 'about', 'label' => 'About Content', 'description' => 'Main content for the about page', 'order' => 2],
            ['key' => 'about_image', 'value' => null, 'value_km' => null, 'type' => 'image', 'group' => 'about', 'label' => 'About Image', 'description' => 'Main image for the about page', 'order' => 3],
            ['key' => 'about_mission', 'value' => 'Our mission is to provide the highest quality products and services to our customers.', 'value_km' => 'បេសកកម្មរបស់យើងគឺផ្តល់ផលិតផល និងសេវាកម្មដែលមានគុណភាពខ្ពស់បំផុតដល់អតិថិជនរបស់យើង។', 'type' => 'textarea', 'group' => 'about', 'label' => 'Mission', 'description' => 'Company mission statement', 'order' => 4],
            ['key' => 'about_vision', 'value' => 'To become the leading provider of premium products in the region.', 'value_km' => 'ក្លាយជាអ្នកផ្តល់ផលិតផលដ៏ល្អបំផុតនៅក្នុងតំបន់។', 'type' => 'textarea', 'group' => 'about', 'label' => 'Vision', 'description' => 'Company vision statement', 'order' => 5],
            ['key' => 'about_values', 'value' => 'Quality, Integrity, Customer Satisfaction, Innovation', 'value_km' => 'គុណភាព, ភាពស្មោះត្រង់, ការពេញចិត្តរបស់អតិថិជន, ការច្នៃប្រឌិត', 'type' => 'textarea', 'group' => 'about', 'label' => 'Values', 'description' => 'Company core values', 'order' => 6],

            // SEO Settings
            ['key' => 'meta_title', 'value' => '360Monica - Premium Shopping', 'value_km' => '360Monica - ទិញឥវ៉ាន់ដ៏ល្អបំផុត', 'type' => 'text', 'group' => 'seo', 'label' => 'Meta Title', 'description' => 'Default meta title for SEO', 'order' => 1],
            ['key' => 'meta_description', 'value' => 'Shop premium products at 360Monica', 'value_km' => 'ទិញឥវ៉ាន់ដ៏ល្អបំផុតនៅ 360Monica', 'type' => 'textarea', 'group' => 'seo', 'label' => 'Meta Description', 'description' => 'Default meta description for SEO', 'order' => 2],
            ['key' => 'meta_keywords', 'value' => 'shopping, ecommerce, premium products', 'value_km' => 'shopping, ecommerce, premium products', 'type' => 'text', 'group' => 'seo', 'label' => 'Meta Keywords', 'description' => 'Comma-separated keywords for SEO', 'order' => 3],
            ['key' => 'google_analytics_id', 'value' => '', 'value_km' => '', 'type' => 'text', 'group' => 'seo', 'label' => 'Google Analytics ID', 'description' => 'Your Google Analytics tracking ID', 'order' => 4],
            ['key' => 'google_tag_manager_id', 'value' => '', 'value_km' => '', 'type' => 'text', 'group' => 'seo', 'label' => 'Google Tag Manager ID', 'description' => 'Your Google Tag Manager ID', 'order' => 5],
            ['key' => 'facebook_pixel_id', 'value' => '', 'value_km' => '', 'type' => 'text', 'group' => 'seo', 'label' => 'Facebook Pixel ID', 'description' => 'Your Facebook Pixel ID', 'order' => 6],
            ['key' => 'og_image', 'value' => null, 'value_km' => null, 'type' => 'image', 'group' => 'seo', 'label' => 'Open Graph Image', 'description' => 'Image for social media sharing (1200x630px recommended)', 'order' => 7],

            // Email Settings
            ['key' => 'smtp_host', 'value' => 'smtp.mailtrap.io', 'value_km' => 'smtp.mailtrap.io', 'type' => 'text', 'group' => 'email', 'label' => 'SMTP Host', 'description' => 'SMTP server hostname', 'order' => 1],
            ['key' => 'smtp_port', 'value' => '2525', 'value_km' => '2525', 'type' => 'number', 'group' => 'email', 'label' => 'SMTP Port', 'description' => 'SMTP server port', 'order' => 2],
            ['key' => 'smtp_username', 'value' => '', 'value_km' => '', 'type' => 'text', 'group' => 'email', 'label' => 'SMTP Username', 'description' => 'SMTP authentication username', 'order' => 3],
            ['key' => 'smtp_password', 'value' => '', 'value_km' => '', 'type' => 'password', 'group' => 'email', 'label' => 'SMTP Password', 'description' => 'SMTP authentication password', 'order' => 4],
            ['key' => 'smtp_encryption', 'value' => 'tls', 'value_km' => 'tls', 'type' => 'text', 'group' => 'email', 'label' => 'SMTP Encryption', 'description' => 'Encryption type (tls/ssl)', 'order' => 5],
            ['key' => 'email_from_name', 'value' => '360Monica', 'value_km' => '360Monica', 'type' => 'text', 'group' => 'email', 'label' => 'From Name', 'description' => 'Name shown in sent emails', 'order' => 6],
            ['key' => 'email_from_address', 'value' => 'noreply@360monica.com', 'value_km' => 'noreply@360monica.com', 'type' => 'email', 'group' => 'email', 'label' => 'From Email', 'description' => 'Email address for sent emails', 'order' => 7],

            // Appearance Settings
            ['key' => 'primary_color', 'value' => '#3b82f6', 'value_km' => '#3b82f6', 'type' => 'text', 'group' => 'appearance', 'label' => 'Primary Color', 'description' => 'Primary brand color (hex code)', 'order' => 1],
            ['key' => 'secondary_color', 'value' => '#8b5cf6', 'value_km' => '#8b5cf6', 'type' => 'text', 'group' => 'appearance', 'label' => 'Secondary Color', 'description' => 'Secondary brand color (hex code)', 'order' => 2],
            ['key' => 'footer_text', 'value' => '© 2024 360Monica. All rights reserved.', 'value_km' => '© 2024 360Monica. រក្សាសិទ្ធិគ្រប់យ៉ាង។', 'type' => 'textarea', 'group' => 'appearance', 'label' => 'Footer Text', 'description' => 'Text displayed in footer', 'order' => 3],

            // Social links remain available to the public API but are not edited on this admin screen.
            ['key' => 'facebook_url', 'value' => '', 'value_km' => '', 'type' => 'url', 'group' => 'social', 'label' => 'Facebook URL', 'description' => 'Your Facebook page URL', 'order' => 1],
            ['key' => 'instagram_url', 'value' => '', 'value_km' => '', 'type' => 'url', 'group' => 'social', 'label' => 'Instagram URL', 'description' => 'Your Instagram profile URL', 'order' => 2],
            ['key' => 'twitter_url', 'value' => '', 'value_km' => '', 'type' => 'url', 'group' => 'social', 'label' => 'Twitter/X URL', 'description' => 'Your Twitter/X profile URL', 'order' => 3],
            ['key' => 'linkedin_url', 'value' => '', 'value_km' => '', 'type' => 'url', 'group' => 'social', 'label' => 'LinkedIn URL', 'description' => 'Your LinkedIn profile URL', 'order' => 4],
            ['key' => 'youtube_url', 'value' => '', 'value_km' => '', 'type' => 'url', 'group' => 'social', 'label' => 'YouTube URL', 'description' => 'Your YouTube channel URL', 'order' => 5],
            ['key' => 'tiktok_url', 'value' => '', 'value_km' => '', 'type' => 'url', 'group' => 'social', 'label' => 'TikTok URL', 'description' => 'Your TikTok profile URL', 'order' => 6],

            // Maintenance
            ['key' => 'maintenance_mode', 'value' => '0', 'value_km' => '0', 'type' => 'boolean', 'group' => 'maintenance', 'label' => 'Enable Maintenance Mode', 'description' => 'Put website in maintenance mode', 'order' => 1],
            ['key' => 'maintenance_message', 'value' => 'We are currently performing maintenance. Please check back soon.', 'value_km' => 'យើងកំពុងធ្វើការថែទាំ។ សូមពិនិត្យម្តងទៀតនៅពេលក្រោយ។', 'type' => 'textarea', 'group' => 'maintenance', 'label' => 'Maintenance Message', 'description' => 'Message shown during maintenance', 'order' => 2],

            // Home Page Content
            ['key' => 'home_hero_title', 'value' => 'Welcome to 360Monica', 'value_km' => 'សូមស្វាគមន៍មកកាន់ 360Monica', 'type' => 'text', 'group' => 'home', 'label' => 'Hero Title', 'description' => 'Main headline on homepage', 'order' => 1],
            ['key' => 'home_hero_subtitle', 'value' => 'Discover premium products and exceptional quality', 'value_km' => 'រកឃើញផលិតផលដ៏ល្អបំផុត និងគុណភាពល្អឥតខ្ចោះ', 'type' => 'textarea', 'group' => 'home', 'label' => 'Hero Subtitle', 'description' => 'Subtitle text on homepage hero section', 'order' => 2],
            ['key' => 'home_hero_image', 'value' => null, 'value_km' => null, 'type' => 'image', 'group' => 'home', 'label' => 'Hero Image', 'description' => 'Main banner image for homepage hero section', 'order' => 3],
            ['key' => 'home_hero_cta_text', 'value' => 'Shop Now', 'value_km' => 'ទិញដូច្នេះ', 'type' => 'text', 'group' => 'home', 'label' => 'Hero CTA Button Text', 'description' => 'Call-to-action button text on hero section', 'order' => 4],
            ['key' => 'home_featured_title', 'value' => 'Featured Products', 'value_km' => 'ផលិតផលលម្អ', 'type' => 'text', 'group' => 'home', 'label' => 'Featured Products Title', 'description' => 'Title for featured products section', 'order' => 5],
            ['key' => 'home_featured_description', 'value' => 'Check out our hand-picked selection of the finest products', 'value_km' => 'មើលដូច្នេះឈានមកយើងបានជ្រើសរើសផលិតផលដ៏ល្អបំផុត', 'type' => 'textarea', 'group' => 'home', 'label' => 'Featured Products Description', 'description' => 'Description for featured products section', 'order' => 6],
            ['key' => 'home_why_choose_title', 'value' => 'Why Choose Us?', 'value_km' => 'ហេតុអ្វីបានជាជ្រើសរើសយើង?', 'type' => 'text', 'group' => 'home', 'label' => '"Why Choose Us" Title', 'description' => 'Title for why choose us section', 'order' => 7],
            ['key' => 'home_promo_banner', 'value' => null, 'value_km' => null, 'type' => 'image', 'group' => 'home', 'label' => 'Promotional Banner', 'description' => 'Special promotional banner image', 'order' => 8],
            ['key' => 'home_promo_text', 'value' => 'Special Offer: Get up to 50% off on selected items!', 'value_km' => 'ការផ្តល់ជូនពិសេស: រករង្វាន់រហូតដល់ 50% អាចទិញផលិតផលដែលបានជ្រើសរើស!', 'type' => 'textarea', 'group' => 'home', 'label' => 'Promotional Text', 'description' => 'Promotional message or offer text', 'order' => 9],

            // About Page Content
            ['key' => 'about_page_hero_image', 'value' => null, 'value_km' => null, 'type' => 'image', 'group' => 'about_page', 'label' => 'About Page Hero Image', 'description' => 'Hero image for about page', 'order' => 1],
            ['key' => 'about_page_intro', 'value' => 'Learn more about 360Monica and our journey', 'value_km' => 'ស្វាគមន៍ដឹងលម្អិតបន្ថែមទៀតអំពី 360Monica និងផ្លូវដែលយើងបានធ្វើ', 'type' => 'textarea', 'group' => 'about_page', 'label' => 'About Intro Text', 'description' => 'Introduction text for about page', 'order' => 2],
            ['key' => 'about_page_story_title', 'value' => 'Our Story', 'value_km' => 'រឿងរបស់យើង', 'type' => 'text', 'group' => 'about_page', 'label' => 'Our Story Title', 'description' => 'Title for company story section', 'order' => 3],
            ['key' => 'about_page_story_content', 'value' => 'Founded in 2020, 360Monica has grown to become a trusted name in premium e-commerce...', 'value_km' => 'ដែលបានឈានដល់ឆ្នាំ 2020 360Monica បានលូតលាស់ក្លាយជាឈ្មោះដែលគេជឿថាក្នុងលេខបាទ...',  'type' => 'textarea', 'group' => 'about_page', 'label' => 'Our Story Content', 'description' => 'Detailed story about the company', 'order' => 4],
            ['key' => 'about_page_story_image', 'value' => null, 'value_km' => null, 'type' => 'image', 'group' => 'about_page', 'label' => 'Story Image', 'description' => 'Image for the story section', 'order' => 5],
            ['key' => 'about_page_team_title', 'value' => 'Meet Our Team', 'value_km' => 'ស្វាគមន៍ឈានមកលេខរបស់យើង', 'type' => 'text', 'group' => 'about_page', 'label' => 'Team Title', 'description' => 'Title for team section', 'order' => 6],
            ['key' => 'about_page_team_description', 'value' => 'We are a dedicated team of professionals committed to excellence', 'value_km' => 'យើងគឺជាក្រុមឯកទេសដែលបានខណ្ឌនៃដែលនឹងយកចលនា', 'type' => 'textarea', 'group' => 'about_page', 'label' => 'Team Description', 'description' => 'Description of team', 'order' => 7],
            ['key' => 'about_page_stats_enabled', 'value' => '1', 'value_km' => '1', 'type' => 'boolean', 'group' => 'about_page', 'label' => 'Show Statistics', 'description' => 'Display statistics section on about page', 'order' => 8],
            ['key' => 'about_page_years_in_business', 'value' => '5', 'value_km' => '5', 'type' => 'number', 'group' => 'about_page', 'label' => 'Years in Business', 'description' => 'Number of years company has been operating', 'order' => 9],
            ['key' => 'about_page_happy_customers', 'value' => '10000', 'value_km' => '10000', 'type' => 'number', 'group' => 'about_page', 'label' => 'Happy Customers', 'description' => 'Number of satisfied customers', 'order' => 10],
            ['key' => 'about_page_products_sold', 'value' => '50000', 'value_km' => '50000', 'type' => 'number', 'group' => 'about_page', 'label' => 'Products Sold', 'description' => 'Number of products sold', 'order' => 11],

            // Contact Page Content
            ['key' => 'contact_page_hero_title', 'value' => 'Get in Touch', 'value_km' => 'ដលូតលាស់ដែលលឺពីយើង', 'type' => 'text', 'group' => 'contact_page', 'label' => 'Contact Page Title', 'description' => 'Main title on contact page', 'order' => 1],
            ['key' => 'contact_page_intro', 'value' => 'Have any questions? We\'d love to hear from you. Send us a message and we\'ll respond as soon as possible.', 'value_km' => 'មានសំណួរណាមួយ? យើងចូលចិត្តដែលលឺពីលោក៉ឆ។ ផ្ញើសារលឺ ហើយយើងនឹងឆ្លើយឡើងវិញក្នុងល្បឿនលឿនបំផុត។', 'type' => 'textarea', 'group' => 'contact_page', 'label' => 'Contact Intro Text', 'description' => 'Introduction text for contact page', 'order' => 2],
            ['key' => 'contact_page_form_title', 'value' => 'Contact Us', 'value_km' => 'ទាក់ទងលោកយើង', 'type' => 'text', 'group' => 'contact_page', 'label' => 'Contact Form Title', 'description' => 'Title above the contact form', 'order' => 3],
            ['key' => 'contact_page_form_description', 'value' => 'Fill out the form below and we will get back to you within 24 hours', 'value_km' => 'សូមបូរាន់ឺរូបបុក្ខលិងលើលូក ហើយយើងនឹងឆ្លើយឡើងវិញឹនខ័ 24 ម៉ោង', 'type' => 'textarea', 'group' => 'contact_page', 'label' => 'Form Description', 'description' => 'Description of contact form', 'order' => 4],
            ['key' => 'contact_page_submit_text', 'value' => 'Send Message', 'value_km' => 'ផ្ញើសារ', 'type' => 'text', 'group' => 'contact_page', 'label' => 'Submit Button Text', 'description' => 'Text on form submit button', 'order' => 5],
            ['key' => 'contact_page_success_message', 'value' => 'Thank you for your message! We will get back to you soon.', 'value_km' => 'សូមថ្លែងអរគុណលើសាររបស់លោកឌ! យើងនឹងឆ្លើយឡើងវិញក្នុងពេលឆាប់ៗ។', 'type' => 'textarea', 'group' => 'contact_page', 'label' => 'Success Message', 'description' => 'Message shown after form submission', 'order' => 6],
            ['key' => 'contact_office_title', 'value' => 'Our Office', 'value_km' => 'ការិយាល័យរបស់យើង', 'type' => 'text', 'group' => 'contact_page', 'label' => 'Office Location Title', 'description' => 'Title for office location section', 'order' => 7],
            ['key' => 'contact_business_hours_title', 'value' => 'Business Hours', 'value_km' => 'ម៉ោងលើក', 'type' => 'text', 'group' => 'contact_page', 'label' => 'Business Hours Title', 'description' => 'Title for business hours section', 'order' => 8],
            ['key' => 'contact_business_hours', 'value' => 'Monday - Friday: 9:00 AM - 6:00 PM, Saturday: 10:00 AM - 4:00 PM, Sunday: Closed', 'value_km' => 'ច័ន្ទ - សុក្រ: 9:00 - 18:00, សៅរ៍: 10:00 - 16:00, អាទិត្យ: បិទ', 'type' => 'textarea', 'group' => 'contact_page', 'label' => 'Business Hours', 'description' => 'Operating hours for the business', 'order' => 9],
            ['key' => 'contact_map_enabled', 'value' => '1', 'value_km' => '1', 'type' => 'boolean', 'group' => 'contact_page', 'label' => 'Show Map', 'description' => 'Display map on contact page', 'order' => 10],
            ['key' => 'contact_map_latitude', 'value' => '11.5564', 'value_km' => '11.5564', 'type' => 'text', 'group' => 'contact_page', 'label' => 'Map Latitude', 'description' => 'Latitude for map location', 'order' => 11],
            ['key' => 'contact_map_longitude', 'value' => '104.9282', 'value_km' => '104.9282', 'type' => 'text', 'group' => 'contact_page', 'label' => 'Map Longitude', 'description' => 'Longitude for map location', 'order' => 12],
            ['key' => 'shipping_fee', 'value' => '2.00', 'value_km' => '2.00', 'type' => 'number', 'group' => 'general', 'label' => 'Shipping Fee ($)', 'description' => 'Fixed shipping fee for all orders', 'order' => 10],
            ['key' => 'telegram_bot_token', 'value' => '', 'value_km' => '', 'type' => 'text', 'group' => 'general', 'label' => 'Telegram Bot Token', 'description' => 'Bot token for Telegram notification updates', 'order' => 11],
            ['key' => 'telegram_chat_id', 'value' => '', 'value_km' => '', 'type' => 'text', 'group' => 'general', 'label' => 'Telegram Chat ID', 'description' => 'Chat ID or Channel ID for Telegram notification updates', 'order' => 12],
        ];

        foreach ($settings as $setting) {
            Setting::updateOrCreate(
                ['key' => $setting['key']],
                $setting
            );
        }
    }
}
