<?php

namespace Database\Seeders;

use App\Models\AccountTitle;
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use Illuminate\Database\Seeder;

class AccountTitleSeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        $AccountTitles = array(
            array('id' => '1', 'name' => 'M/s.', 'code' => 'M/s.', 'value' => 'M/s.', 'gender_id' => '1', 'priority' => '1', 'status' => '1'),
            array('id' => '2', 'name' => 'Mr.', 'code' => 'Mr.', 'value' => 'Mr.', 'gender_id' => '1', 'priority' => '2', 'status' => '1'),
            array('id' => '3', 'name' => 'Mrs.', 'code' => 'Mrs.', 'value' => 'Mrs.', 'gender_id' => '2', 'priority' => '3', 'status' => '1'),
            array('id' => '4', 'name' => 'Miss.', 'code' => 'Miss.', 'value' => 'Miss.', 'gender_id' => '2', 'priority' => '4', 'status' => '1'),
            array('id' => '5', 'name' => 'Baby', 'code' => 'Baby', 'value' => 'Baby', 'gender_id' => '1', 'priority' => '5', 'status' => '1'),
            array('id' => '6', 'name' => 'Baby', 'code' => 'Baby', 'value' => 'Baby', 'gender_id' => '2', 'priority' => '6', 'status' => '1'),
            array('id' => '7', 'name' => 'Master', 'code' => 'Master', 'value' => 'Master', 'gender_id' => '1', 'priority' => '7', 'status' => '1'),
            array('id' => '8', 'name' => 'Md.', 'code' => 'Md.', 'value' => 'Md.', 'gender_id' => '1', 'priority' => '8', 'status' => '1'),
            array('id' => '9', 'name' => 'Md.', 'code' => 'Md.', 'value' => 'Md.', 'gender_id' => '2', 'priority' => '9', 'status' => '1'),
            array('id' => '10', 'name' => 'Dr.', 'code' => 'Dr.', 'value' => 'Dr.', 'gender_id' => '1', 'priority' => '10', 'status' => '1'),
            array('id' => '11', 'name' => 'Dr.', 'code' => 'Dr.', 'value' => 'Dr.', 'gender_id' => '2', 'priority' => '11', 'status' => '1'),
            array('id' => '12', 'name' => 'Ms.', 'code' => 'Ms.', 'value' => 'Ms.', 'gender_id' => '1', 'priority' => '12', 'status' => '1'),
            array('id' => '13', 'name' => 'Ms.', 'code' => 'Ms.', 'value' => 'Ms.', 'gender_id' => '2', 'priority' => '13', 'status' => '1'),
            array('id' => '14', 'name' => 'Baby of', 'code' => 'Baby of', 'value' => 'Baby of', 'gender_id' => '1', 'priority' => '14', 'status' => '1'),
            array('id' => '15', 'name' => 'Baby of', 'code' => 'Baby of', 'value' => 'Baby of', 'gender_id' => '2', 'priority' => '15', 'status' => '1')
        );

        // AccountTitle::insert($AccountTitles);
        foreach ($AccountTitles as $data) {
            AccountTitle::firstOrCreate(
                ['code' => $data['code'], 'gender_id' => $data['gender_id']],
                $data
            );
        }
    }
}
