<?php

namespace Database\Seeders;

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

class AgentSeeder extends Seeder
{
    public function run(): void
    {
        $agents = [
            ['name' => 'Iresh Tennakoon', 'email' => 'iresh.t@harcourts.co.nz', 'phone' => '021 123 4567', 'branch' => 'Pukekohe', 'active' => true],
            ['name' => 'Mark Williams', 'email' => 'mark.w@harcourts.co.nz', 'phone' => '027 987 6543', 'branch' => 'Manukau', 'active' => true],
            ['name' => 'Jane Smith', 'email' => 'jane.smith@harcourts.co.nz', 'phone' => '022 555 7890', 'branch' => 'Papakura', 'active' => true],
        ];

        foreach ($agents as $a) {
            Agent::updateOrCreate(
                ['name' => $a['name']],
                $a
            );
        }
    }
}
