mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/portal.git
synced 2026-08-19 12:34:01 +00:00
158 lines
5.9 KiB
PHP
158 lines
5.9 KiB
PHP
<?php
|
|
|
|
namespace Database\Seeders;
|
|
|
|
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()]);
|
|
$china = $this->fetchesCountry->execute(['name' => country('cn')->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
|
|
]
|
|
]);
|
|
|
|
|
|
DB::table('states')->insert([
|
|
[ 'country_id' => $china->id, 'name'=> '北京市', 'status' => 1 ],
|
|
[ 'country_id' => $china->id, 'name'=> '天津市', 'status' => 1 ],
|
|
[ 'country_id' => $china->id, 'name'=> '河北省', 'status' => 1 ],
|
|
[ 'country_id' => $china->id, 'name'=> '山西省', 'status' => 1 ],
|
|
[ 'country_id' => $china->id, 'name'=> '内蒙古自治区', 'status' => 1 ],
|
|
[ 'country_id' => $china->id, 'name'=> '辽宁省', 'status' => 1 ],
|
|
[ 'country_id' => $china->id, 'name'=> '吉林省', 'status' => 1 ],
|
|
[ 'country_id' => $china->id, 'name'=> '黑龙江省', 'status' => 1 ],
|
|
[ 'country_id' => $china->id, 'name'=> '上海市', 'status' => 1 ],
|
|
[ 'country_id' => $china->id, 'name'=> '江苏省', 'status' => 1 ],
|
|
[ 'country_id' => $china->id, 'name'=> '浙江省', 'status' => 1 ],
|
|
[ 'country_id' => $china->id, 'name'=> '安徽省', 'status' => 1 ],
|
|
[ 'country_id' => $china->id, 'name'=> '福建省', 'status' => 1 ],
|
|
[ 'country_id' => $china->id, 'name'=> '江西省', 'status' => 1 ],
|
|
[ 'country_id' => $china->id, 'name'=> '山东省', 'status' => 1 ],
|
|
[ 'country_id' => $china->id, 'name'=> '河南省', 'status' => 1 ],
|
|
[ 'country_id' => $china->id, 'name'=> '湖北省', 'status' => 1 ],
|
|
[ 'country_id' => $china->id, 'name'=> '湖南省', 'status' => 1 ],
|
|
[ 'country_id' => $china->id, 'name'=> '广东省', 'status' => 1 ],
|
|
[ 'country_id' => $china->id, 'name'=> '广西壮族自治区', 'status' => 1 ],
|
|
[ 'country_id' => $china->id, 'name'=> '海南省', 'status' => 1 ],
|
|
[ 'country_id' => $china->id, 'name'=> '重庆市', 'status' => 1 ],
|
|
[ 'country_id' => $china->id, 'name'=> '四川省', 'status' => 1 ],
|
|
[ 'country_id' => $china->id, 'name'=> '贵州省', 'status' => 1 ],
|
|
[ 'country_id' => $china->id, 'name'=> '云南省', 'status' => 1 ],
|
|
[ 'country_id' => $china->id, 'name'=> '西藏自治区', 'status' => 1 ],
|
|
[ 'country_id' => $china->id, 'name'=> '陕西省', 'status' => 1 ],
|
|
[ 'country_id' => $china->id, 'name'=> '甘肃省', 'status' => 1 ],
|
|
[ 'country_id' => $china->id, 'name'=> '青海省', 'status' => 1 ],
|
|
[ 'country_id' => $china->id, 'name'=> '宁夏回族自治区', 'status' => 1 ],
|
|
[ 'country_id' => $china->id, 'name'=> '新疆维吾尔自治区', 'status' => 1 ],
|
|
[ 'country_id' => $china->id, 'name'=> '台湾省', 'status' => 1 ],
|
|
[ 'country_id' => $china->id, 'name'=> '香港特别行政区', 'status' => 1 ],
|
|
[ 'country_id' => $china->id, 'name'=> '澳门特别行政区', 'status' => 1 ]
|
|
]);
|
|
}
|
|
}
|