<?php

use Illuminate\Database\Seeder;

require 'MstTownSub1_1Seeder.php';
require 'MstTownSub1_2Seeder.php';
require 'MstTownSub1_3Seeder.php';
require 'MstTownSub1_4Seeder.php';
require 'MstTownSub2Seeder.php';
require 'MstTownSub3Seeder.php';
require 'MstTownSub4Seeder.php';
require 'MstTownSub5Seeder.php';
require 'MstTownSub6Seeder.php';
require 'MstTownSub7Seeder.php';
require 'MstTownSub8Seeder.php';
require 'MstTownSub9Seeder.php';
require 'MstTownSub10Seeder.php';
require 'MstTownSub11Seeder.php';
require 'MstTownSub12Seeder.php';
require 'MstTownSub13Seeder.php';
require 'MstTownSub14Seeder.php';
require 'MstTownSub15Seeder.php';
require 'MstTownSub16Seeder.php';
require 'MstTownSub17Seeder.php';
require 'MstTownSub18Seeder.php';
require 'MstTownSub19Seeder.php';
require 'MstTownSub20Seeder.php';
require 'MstTownSub21Seeder.php';
require 'MstTownSub22Seeder.php';
require 'MstTownSub23_1Seeder.php';
require 'MstTownSub23_2Seeder.php';
require 'MstTownSub24Seeder.php';
require 'MstTownSub25Seeder.php';
require 'MstTownSub26Seeder.php';
require 'MstTownSub27Seeder.php';
require 'MstTownSub28Seeder.php';
require 'MstTownSub29Seeder.php';
require 'MstTownSub30Seeder.php';
require 'MstTownSub31Seeder.php';
require 'MstTownSub32Seeder.php';
require 'MstTownSub33Seeder.php';
require 'MstTownSub34Seeder.php';
require 'MstTownSub35Seeder.php';
require 'MstTownSub36Seeder.php';
require 'MstTownSub37Seeder.php';
require 'MstTownSub38Seeder.php';
require 'MstTownSub39Seeder.php';
require 'MstTownSub40Seeder.php';
require 'MstTownSub41Seeder.php';
require 'MstTownSub42Seeder.php';
require 'MstTownSub43Seeder.php';
require 'MstTownSub44Seeder.php';
require 'MstTownSub45Seeder.php';
require 'MstTownSub46Seeder.php';
require 'MstTownSub47Seeder.php';

class MstTownsSeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        $target = [
            "1_1", "1_2", "1_3", "1_4", "2", "3", "4", "5", "6", "7", "8", "9", "10", 
            "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", 
            "23_1", "23_2", "24", "25", "26", "27", "28", "29", "30", "31", "32", "33", 
            "34", "35", "36", "37", "38", "39", "40", "41", "42", "43", "44", "45", "46", "47",
        ];

        // データのクリア
        DB::table('mst_towns')->truncate();

        foreach($target as $num) {
            $name = "MstTownSub{$num}Seeder";
            ${"sub".$num} = new $name();
            ${"sub".$num}->run();
        }
    }
}
