<?php

namespace App\Database\Seeds;

use CodeIgniter\Database\Seeder;

class InstallSeeder extends Seeder
{
    public function run()
    {
        $dataAdmin = [
            'name' => 'Administrator',
            'email' => 'admin@example.com',
            'password' => password_hash('password', PASSWORD_DEFAULT),
            'created_at' => date('Y-m-d H:i:s'),
            'updated_at' => date('Y-m-d H:i:s'),
        ];
        $this->db->table('admins')->insert($dataAdmin);

        $dataSettings = [
            ['key_name' => 'site_name', 'value' => 'Premium Spice Exports'],
            ['key_name' => 'contact_email', 'value' => 'info@example.com'],
            ['key_name' => 'phone', 'value' => '+1234567890'],
            ['key_name' => 'whatsapp', 'value' => '+1234567890'],
            ['key_name' => 'address', 'value' => '123 Spice Route, Trade City'],
            ['key_name' => 'seo_meta_title', 'value' => 'Premium Spice Exports | Quality Herbs and Resin Oils'],
            ['key_name' => 'seo_meta_description', 'value' => 'Global exporter of premium spices, herbs, resin oils, and agricultural products.'],
            ['key_name' => 'facebook_link', 'value' => '#'],
            ['key_name' => 'instagram_link', 'value' => '#'],
            ['key_name' => 'linkedin_link', 'value' => '#'],
        ];
        $this->db->table('settings')->insertBatch($dataSettings);

        $dataPages = [
            [
                'slug' => 'about',
                'title' => 'About Us',
                'heading' => 'Our Story',
                'content' => '<p>Welcome to our premium spice export company. We source the finest agricultural products from the best farms globally.</p>',
                'meta_title' => 'About Us | Premium Spice Exports',
                'meta_description' => 'Learn about our journey in the spice export industry.',
                'updated_at' => date('Y-m-d H:i:s')
            ]
        ];
        $this->db->table('pages')->insertBatch($dataPages);
    }
}
