Address.php
8.6 KB
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
<?php
namespace Faker\Provider\vi_VN;
class Address extends \Faker\Provider\Address
{
protected static $buildingNumber = ['%###', '%##', '%#', '%'];
protected static $postcode = ['#####', '######', '#####-####'];
protected static $province = [
'An Giang', 'Bà Rịa - Vũng Tàu',
'Bắc Giang', 'Bắc Kạn', 'Bạc Liêu',
'Bắc Ninh', 'Bến Tre', 'Bình Định',
'Bình Dương', 'Bình Phước', 'Bình Thuận',
'Cà Mau', 'Cao Bằng', 'Đắk Lắk',
'Đắk Nông', 'Điện Biên', 'Đồng Nai',
'Đồng Tháp', 'Gia Lai', 'Hà Giang',
'Hà Nam', 'Hà Tĩnh', 'Hải Dương',
'Hậu Giang', 'Hòa Bình', 'Hưng Yên',
'Khánh Hòa', 'Kiên Giang', 'Kon Tum',
'Lai Châu', 'Lâm Đồng', 'Lạng Sơn',
'Lào Cai', 'Long An', 'Nam Định',
'Nghệ An', 'Ninh Bình', 'Ninh Thuận',
'Phú Thọ', 'Quảng Bình', 'Quảng Nam',
'Quảng Ngãi', 'Quảng Ninh', 'Quảng Trị',
'Sóc Trăng', 'Sơn La', 'Tây Ninh',
'Thái Bình', 'Thái Nguyên', 'Thanh Hóa',
'Thừa Thiên Huế', 'Tiền Giang', 'Trà Vinh',
'Tuyên Quang', 'Vĩnh Long', 'Vĩnh Phúc',
'Yên Bái', 'Phú Yên',
];
protected static $city = [
'Cần Thơ', 'Đà Nẵng', 'Hải Phòng', 'Hà Nội', 'Hồ Chí Minh',
];
protected static $streetNameFormats = [
'Phố {{lastName}} {{middleName}} {{firstName}}',
'Phố {{lastName}} {{middleName}} {{firstName}}',
'Phố {{lastName}} {{middleName}} {{firstName}}',
'Phố {{firstName}}',
'Phố {{lastName}}',
];
protected static $streetAddressFormats = [
'{{buildingNumber}} {{streetName}}',
];
protected static $hamletNameFormats = [
'{{hamletPrefix}} {{middleName}} {{firstName}}',
'{{hamletPrefix}} {{lastName}} {{firstName}}',
'{{hamletPrefix}} {{firstName}} {{lastName}}',
'{{hamletPrefix}} {{middleName}} {{firstName}}',
'{{hamletPrefix}} {{lastName}} {{middleName}} {{firstName}}',
'{{hamletPrefix}} {{firstName}}',
'{{hamletPrefix}} {{lastName}}',
'{{hamletPrefix}} ##',
'{{hamletPrefix}} #',
];
protected static $hamletPrefix = [
'Thôn', 'Ấp',
];
protected static $wardNameFormats = [
'{{hamletPrefix}} {{middleName}} {{firstName}}',
'{{hamletPrefix}} {{lastName}} {{firstName}}',
'{{wardPrefix}} {{firstName}} {{lastName}}',
'{{wardPrefix}} {{middleName}} {{firstName}}',
'{{wardPrefix}} {{lastName}} {{middleName}} {{firstName}}',
'{{wardPrefix}} {{firstName}}',
'{{wardPrefix}} {{lastName}}',
'{{wardPrefix}} ##',
'{{wardPrefix}} #',
];
protected static $wardPrefix = [
'Phường', 'Xã',
];
protected static $districtNameFormats = [
'{{districtPrefix}} {{middleName}} {{firstName}}',
'{{districtPrefix}} {{lastName}} {{firstName}}',
'{{districtPrefix}} {{firstName}} {{lastName}}',
'{{districtPrefix}} {{middleName}} {{firstName}}',
'{{districtPrefix}} {{lastName}} {{middleName}} {{firstName}}',
'{{districtPrefix}} {{firstName}}',
'{{districtPrefix}} {{lastName}}',
'{{districtPrefix}} ##',
'{{districtPrefix}} #',
];
protected static $districtPrefix = [
'Quận', 'Huyện',
];
protected static $addressFormats = [
"{{streetAddress}}, {{wardName}}, {{districtName}}\n{{city}}",
"{{streetAddress}}, {{wardName}}, {{districtName}}\n{{province}}",
"{{buildingNumber}}, {{hamletName}}, {{wardName}}, {{districtName}}\n{{province}}",
];
protected static $country = [
'Afghanistan', 'Albania', 'Algeria', 'American Samoa', 'Andorra', 'Angola', 'Anguilla', 'Antarctica (the territory South of 60 deg S)', 'Antigua and Barbuda', 'Argentina', 'Armenia', 'Aruba', 'Australia', 'Austria', 'Azerbaijan',
'Bahamas', 'Bahrain', 'Bangladesh', 'Barbados', 'Belarus', 'Belgium', 'Belize', 'Benin', 'Bermuda', 'Bhutan', 'Bolivia', 'Bosnia and Herzegovina', 'Botswana', 'Bouvet Island (Bouvetoya)', 'Brazil', 'British Indian Ocean Territory (Chagos Archipelago)', 'British Virgin Islands', 'Brunei Darussalam', 'Bulgaria', 'Burkina Faso', 'Burundi',
'Cambodia', 'Cameroon', 'Canada', 'Cape Verde', 'Cayman Islands', 'Central African Republic', 'Chad', 'Chile', 'China', 'Christmas Island', 'Cocos (Keeling) Islands', 'Colombia', 'Comoros', 'Congo', 'Cook Islands', 'Costa Rica', 'Cote d\'Ivoire', 'Croatia', 'Cuba', 'Cyprus', 'Czech Republic',
'Denmark', 'Djibouti', 'Dominica', 'Dominican Republic',
'Ecuador', 'Egypt', 'El Salvador', 'Equatorial Guinea', 'Eritrea', 'Estonia', 'Ethiopia',
'Faroe Islands', 'Falkland Islands (Malvinas)', 'Fiji', 'Finland', 'France', 'French Guiana', 'French Polynesia', 'French Southern Territories',
'Gabon', 'Gambia', 'Georgia', 'Germany', 'Ghana', 'Gibraltar', 'Greece', 'Greenland', 'Grenada', 'Guadeloupe', 'Guam', 'Guatemala', 'Guernsey', 'Guinea', 'Guinea-Bissau', 'Guyana',
'Haiti', 'Heard Island and McDonald Islands', 'Holy See (Vatican City State)', 'Honduras', 'Hong Kong', 'Hungary',
'Iceland', 'India', 'Indonesia', 'Iran', 'Iraq', 'Ireland', 'Isle of Man', 'Israel', 'Italy',
'Jamaica', 'Japan', 'Jersey', 'Jordan',
'Kazakhstan', 'Kenya', 'Kiribati', 'Korea', 'Korea', 'Kuwait', 'Kyrgyz Republic',
'Lao People\'s Democratic Republic', 'Latvia', 'Lebanon', 'Lesotho', 'Liberia', 'Libyan Arab Jamahiriya', 'Liechtenstein', 'Lithuania', 'Luxembourg',
'Macao', 'Macedonia', 'Madagascar', 'Malawi', 'Malaysia', 'Maldives', 'Mali', 'Malta', 'Marshall Islands', 'Martinique', 'Mauritania', 'Mauritius', 'Mayotte', 'Mexico', 'Micronesia', 'Moldova', 'Monaco', 'Mongolia', 'Montenegro', 'Montserrat', 'Morocco', 'Mozambique', 'Myanmar',
'Namibia', 'Nauru', 'Nepal', 'Netherlands Antilles', 'Netherlands', 'New Caledonia', 'New Zealand', 'Nicaragua', 'Niger', 'Nigeria', 'Niue', 'Norfolk Island', 'Northern Mariana Islands', 'Norway',
'Oman',
'Pakistan', 'Palau', 'Palestinian Territories', 'Panama', 'Papua New Guinea', 'Paraguay', 'Peru', 'Philippines', 'Pitcairn Islands', 'Poland', 'Portugal', 'Puerto Rico',
'Qatar',
'Reunion', 'Romania', 'Russian Federation', 'Rwanda',
'Saint Barthelemy', 'Saint Helena', 'Saint Kitts and Nevis', 'Saint Lucia', 'Saint Martin', 'Saint Pierre and Miquelon', 'Saint Vincent and the Grenadines', 'Samoa', 'San Marino', 'Sao Tome and Principe', 'Saudi Arabia', 'Senegal', 'Serbia', 'Seychelles', 'Sierra Leone', 'Singapore', 'Slovakia (Slovak Republic)', 'Slovenia', 'Solomon Islands', 'Somalia', 'South Africa', 'South Georgia and the South Sandwich Islands', 'Spain', 'Sri Lanka', 'Sudan', 'Suriname', 'Svalbard & Jan Mayen Islands', 'Swaziland', 'Sweden', 'Switzerland', 'Syrian Arab Republic',
'Taiwan', 'Tajikistan', 'Tanzania', 'Thailand', 'Timor-Leste', 'Togo', 'Tokelau', 'Tonga', 'Trinidad and Tobago', 'Tunisia', 'Turkey', 'Turkmenistan', 'Turks and Caicos Islands', 'Tuvalu',
'Uganda', 'Ukraine', 'United Arab Emirates', 'United Kingdom', 'United States of America', 'United States Minor Outlying Islands', 'United States Virgin Islands', 'Uruguay', 'Uzbekistan',
'Vanuatu', 'Venezuela', 'Vietnam',
'Wallis and Futuna', 'Western Sahara',
'Yemen',
'Zambia', 'Zimbabwe',
];
public function hamletName()
{
$format = static::randomElement(static::$hamletNameFormats);
return static::bothify($this->generator->parse($format));
}
public function hamletPrefix()
{
return static::randomElement(static::$hamletPrefix);
}
public function wardName()
{
$format = static::randomElement(static::$wardNameFormats);
return static::bothify($this->generator->parse($format));
}
public function wardPrefix()
{
return static::randomElement(static::$wardPrefix);
}
public function districtName()
{
$format = static::randomElement(static::$districtNameFormats);
return static::bothify($this->generator->parse($format));
}
public function districtPrefix()
{
return static::randomElement(static::$districtPrefix);
}
/**
* @example 'Hà Nội'
*/
public function city()
{
return static::randomElement(static::$city);
}
/**
* @example 'Bắc Giang'
*/
public static function province()
{
return static::randomElement(static::$province);
}
}