<?php

namespace Database\Seeders;

use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\DB;

class CompaniesSeeder extends Seeder
{
    public function run()
    {
        // Define the number of companies you want to generate
        $numCompanies = 1;

        // Generate dummy data for companies
        for ($i = 0; $i < $numCompanies; $i++) {
            DB::table('companies')->insert([
                'company_type_id' => 1, // Replace 5 with the maximum company_type_id in your company_types table
                'name' => 'Company ' . ($i + 1),
                'name_en' => 'Company ' . ($i + 1) . ' (English)',
                'address' => 'Address ' . ($i + 1),
                'district' => 'District ' . ($i + 1),
                'sub_province' => 'Sub Province ' . ($i + 1),
                'province' => 'Province ' . ($i + 1),
                'postcode' => '1000' . ($i + 1), // Replace '1000' with the desired postcode prefix
                'contry_code' => '+66', // Replace '+66' with the desired country code
                'phone' => '123456789' . ($i + 1), // Replace '123456789' with the desired phone number prefix
                'fax' => '987654321' . ($i + 1), // Replace '987654321' with the desired fax number prefix
                'tax' => '1234567890123', // Replace '1234567890123' with the desired tax number
                'branch' => 'Branch ' . ($i + 1),
                'tax_incentive' => 'Tax Incentive ' . ($i + 1),
                'created_at' => now(),
                'updated_at' => now(),
            ]);
        }
    }
}