<?php

namespace Database\Seeders;

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

final class BetProviderSeeder extends Seeder
{
    public function run(): void
    {
        $rows = [
            ['code' => 'SG', 'name' => 'Singapore', 'sort_order' => 10],
            ['code' => 'MY', 'name' => 'Malaysia', 'sort_order' => 20],
            ['code' => 'TH', 'name' => 'Thailand', 'sort_order' => 30],
        ];

        foreach ($rows as $row) {
            BetProvider::query()->updateOrCreate(
                ['code' => $row['code']],
                [
                    'name' => $row['name'],
                    'is_enabled' => true,
                    'sort_order' => $row['sort_order'],
                ],
            );
        }
    }
}
