<?php

use App\Classes\Modules\Countries\Services\FetchesCountry;
use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\DB;

class StatesTableSeeder extends Seeder
{

    /** @var FetchesCountry */
    private $fetchesCountry;

    /**
     * StatesTableSeeder constructor.
     * @param FetchesCountry $fetchesCountry
     */
    public function __construct(FetchesCountry $fetchesCountry)
    {
        $this->fetchesCountry = $fetchesCountry;
    }


    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {

        $malaysia = $this->fetchesCountry->execute(['name' => country('my')->getName()]);
        DB::table('states')->insert([
            [
                'country_id' => $malaysia->id,
                'name' => 'Johor',
                'status' => 1
            ],
            [
                'country_id' => $malaysia->id,
                'name' => 'Kedah',
                'status' => 1
            ],
            [
                'country_id' => $malaysia->id,
                'name' => 'Kelantan',
                'status' => 1
            ],
            [
                'country_id' => $malaysia->id,
                'name' => 'Kuala Lumpur',
                'status' => 1
            ],
            [
                'country_id' => $malaysia->id,
                'name' => 'Labuan',
                'status' => 1
                
            ],
            [
                'country_id' => $malaysia->id,
                'name' => 'Melaka',
                'status' => 1
            ],
            [
                'country_id' => $malaysia->id,
                'name' => 'Negeri Sembilan',
                'status' => 1
            ],
            [
                'country_id' => $malaysia->id,
                'name' => 'Pahang',
                'status' => 1
            ],
            [
                'country_id' => $malaysia->id,
                'name' => 'Perak',
                'status' => 1
            ],
            [
                'country_id' => $malaysia->id,
                'name' => 'Perlis',
                'status' => 1
            ],
            [
                'country_id' => $malaysia->id,
                'name' => 'Pulau Pinang',
                'status' => 1
            ],
            [
                'country_id' => $malaysia->id,
                'name' => 'Putrajaya',
                'status' => 1
            ],
            [
                'country_id' => $malaysia->id,
                'name' => 'Sabah',
                'status' => 1
            ],
            [
                'country_id' => $malaysia->id,
                'name' => 'Sarawak',
                'status' => 1
            ],
            [
                'country_id' => $malaysia->id,
                'name' => 'Selangor',
                'status' => 1
            ],
            [
                'country_id' => $malaysia->id,
                'name' => 'Terengganu',
                'status' => 1
            ]
        ]);
    }
}
