<?php

namespace Database\Seeders;

use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use Illuminate\Database\Seeder;

use App\Models\SiteSetting;
use App\Models\PageContent;

class SiteContentSeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        // Global Settings
        $settings = [
            'site_name' => 'Touchfoundation',
            'contact_email' => 'info@touchfoundation.org',
            'contact_phone' => '123 Charity Lane, City',
            'contact_address' => '123 Charity Lane, City',
            'working_hours' => 'Mon - Fri 09 - 18',
            'footer_about' => 'Touchfoundation is dedicated to creating positive community impact through education and volunteer action.',
        ];

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

        // Page Contents
        $pages = [
            [
                'page_slug' => 'about',
                'section_name' => 'history',
                'title' => 'History',
                'body' => 'Touchfoundation began with a small team committed to making education and social support accessible to underserved communities.',
            ],
            [
                'page_slug' => 'about',
                'section_name' => 'mission',
                'title' => 'Mission',
                'body' => 'Our mission is to create positive community impact through workshops, volunteer programs, and partnerships.',
            ],
            [
                'page_slug' => 'join',
                'section_name' => 'team',
                'title' => 'Our Team',
                'body' => 'We are always looking for passionate individuals to join our professional staff.',
            ],
            [
                'page_slug' => 'sponsors',
                'section_name' => 'options',
                'title' => 'Sponsorship Options',
                'body' => 'We offer support packages for community events, education programs, and long-term partnerships.',
            ]
        ];

        foreach ($pages as $page) {
            PageContent::updateOrCreate(
                ['page_slug' => $page['page_slug'], 'section_name' => $page['section_name']],
                ['title' => $page['title'], 'body' => $page['body']]
            );
        }
    }
}
