forked from le-yo/LaravelSeeder---Counties-in-kenya
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CountiesTableSeeder.php
executable file
·73 lines (68 loc) · 2 KB
/
CountiesTableSeeder.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
<?php
// Larevel 4.2 Seeder for 47 Counties in Kenya
/*
* @Author: Leonard Korir
* @Date: Dec 18th 2014
* @mail: [email protected]
*/
use Faker\Factory as Faker;
class CountiesTableSeeder extends Seeder {
public function run() {
//remove foreign key check
DB::statement('SET FOREIGN_KEY_CHECKS=0;');
//truncate existing table if any
DB::table('counties')->truncate();
DB::table('counties')->delete();
DB::table('counties')->insert(array(
array('name' => 'BOMET'),
array('name' => 'BUNGOMA'),
array('name' => 'BUSIA'),
array('name' => 'ELGEYO/MARAKWET'),
array('name' => 'EMBU'),
array('name' => 'GARISSA'),
array('name' => 'HOMA BAY'),
array('name' => 'ISIOLO'),
array('name' => 'KAJIADO'),
array('name' => 'KAKAMEGA'),
array('name' => 'KERICHO'),
array('name' => 'KIAMBU'),
array('name' => 'KILIFI'),
array('name' => 'KIRINYAGA'),
array('name' => 'KISII'),
array('name' => 'KISUMU'),
array('name' => 'KITUI'),
array('name' => 'KWALE'),
array('name' => 'LAIKIPIA'),
array('name' => 'LAMU'),
array('name' => 'MACHAKOS'),
array('name' => 'MAKUENI'),
array('name' => 'MANDERA'),
array('name' => 'MARSABIT'),
array('name' => 'MERU'),
array('name' => 'MIGORI'),
array('name' => 'MOMBASA'),
array('name' => 'MURANGA'),
array('name' => 'NAIROBI'),
array('name' => 'NAKURU'),
array('name' => 'NANDI'),
array('name' => 'NAROK'),
array('name' => 'NYAMIRA'),
array('name' => 'NYANDARUA'),
array('name' => 'NYERI'),
array('name' => 'SAMBURU'),
array('name' => 'SIAYA'),
array('name' => 'TAITA TAVETA'),
array('name' => 'TANA RIVER'),
array('name' => 'THARAKA - NITHI'),
array('name' => 'TRANS NZOIA'),
array('name' => 'TURKANA'),
array('name' => 'UASIN GISHU'),
array('name' => 'VIHIGA'),
array('name' => 'WAJIR'),
array('name' => 'WEST POKOT'),
array('name' => 'BARINGO'))
);
//reset foreign key check
DB::statement('SET FOREIGN_KEY_CHECKS=1;');
}
}