├── .gitignore ├── Collections ├── CollectionsSuggestMode.php └── meta.yaml ├── Countries ├── CountriesSuggestMode.php └── meta.yaml ├── Forms ├── FormsSuggestMode.php └── meta.yaml ├── StatesProvinces ├── StatesProvincesSuggestMode.php └── meta.yaml ├── Typeforms ├── TypeformsSuggestMode.php ├── default.yaml └── meta.yaml ├── UsersFiltered ├── UsersFilteredSuggestMode.php └── meta.yaml └── readme.md /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | .idea 3 | Thumbs.db -------------------------------------------------------------------------------- /Collections/CollectionsSuggestMode.php: -------------------------------------------------------------------------------- 1 | $collection) { 18 | $data[$index]['value'] = $collection->path(); 19 | $data[$index]['text'] = $collection->data()['title']; 20 | $index++; 21 | } 22 | 23 | return $data; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Collections/meta.yaml: -------------------------------------------------------------------------------- 1 | name: Collections Suggest Mode 2 | version: 1.0.0 3 | description: Suggest Mode for list of available collections 4 | url: https://github.com/lesaff/statamicv2-suggestmodes 5 | developer: Rudy Affandi 6 | developer_url: https://github.com/lesaff 7 | -------------------------------------------------------------------------------- /Countries/CountriesSuggestMode.php: -------------------------------------------------------------------------------- 1 | 'Afghanistan', 'text' => 'Afghanistan'], 15 | ['value' => 'Aland Islands ', 'text' => 'Aland Islands '], 16 | ['value' => 'Albania', 'text' => 'Albania'], 17 | ['value' => 'Algeria', 'text' => 'Algeria'], 18 | ['value' => 'American Samoa', 'text' => 'American Samoa'], 19 | ['value' => 'Andorra', 'text' => 'Andorra'], 20 | ['value' => 'Angola', 'text' => 'Angola'], 21 | ['value' => 'Anguilla', 'text' => 'Anguilla'], 22 | ['value' => 'Antarctica', 'text' => 'Antarctica'], 23 | ['value' => 'Antigua and Barbuda', 'text' => 'Antigua and Barbuda'], 24 | ['value' => 'Argentina', 'text' => 'Argentina'], 25 | ['value' => 'Armenia', 'text' => 'Armenia'], 26 | ['value' => 'Aruba', 'text' => 'Aruba'], 27 | ['value' => 'Australia', 'text' => 'Australia'], 28 | ['value' => 'Austria', 'text' => 'Austria'], 29 | ['value' => 'Azerbaijan', 'text' => 'Azerbaijan'], 30 | ['value' => 'Bahamas', 'text' => 'Bahamas'], 31 | ['value' => 'Bahrain', 'text' => 'Bahrain'], 32 | ['value' => 'Bangladesh', 'text' => 'Bangladesh'], 33 | ['value' => 'Barbados', 'text' => 'Barbados'], 34 | ['value' => 'Belarus', 'text' => 'Belarus'], 35 | ['value' => 'Belgium', 'text' => 'Belgium'], 36 | ['value' => 'Belize', 'text' => 'Belize'], 37 | ['value' => 'Benin', 'text' => 'Benin'], 38 | ['value' => 'Bermuda', 'text' => 'Bermuda'], 39 | ['value' => 'Bhutan', 'text' => 'Bhutan'], 40 | ['value' => 'Bolivia, Plurinational State of', 'text' => 'Bolivia, Plurinational State of'], 41 | ['value' => 'Bonaire, Sint Eustatius and Saba', 'text' => 'Bonaire, Sint Eustatius and Saba'], 42 | ['value' => 'Bosnia and Herzegovina', 'text' => 'Bosnia and Herzegovina'], 43 | ['value' => 'Botswana', 'text' => 'Botswana'], 44 | ['value' => 'Bouvet Island', 'text' => 'Bouvet Island'], 45 | ['value' => 'Brazil', 'text' => 'Brazil'], 46 | ['value' => 'British Indian Ocean Territory', 'text' => 'British Indian Ocean Territory'], 47 | ['value' => 'Brunei Darussalam', 'text' => 'Brunei Darussalam'], 48 | ['value' => 'Bulgaria', 'text' => 'Bulgaria'], 49 | ['value' => 'Burkina Faso', 'text' => 'Burkina Faso'], 50 | ['value' => 'Burundi', 'text' => 'Burundi'], 51 | ['value' => 'Cambodia', 'text' => 'Cambodia'], 52 | ['value' => 'Cameroon', 'text' => 'Cameroon'], 53 | ['value' => 'Canada', 'text' => 'Canada'], 54 | ['value' => 'Cape Verde', 'text' => 'Cape Verde'], 55 | ['value' => 'Cayman Islands', 'text' => 'Cayman Islands'], 56 | ['value' => 'Central African Republic', 'text' => 'Central African Republic'], 57 | ['value' => 'Chad', 'text' => 'Chad'], 58 | ['value' => 'Chile', 'text' => 'Chile'], 59 | ['value' => 'China', 'text' => 'China'], 60 | ['value' => 'Christmas Island', 'text' => 'Christmas Island'], 61 | ['value' => 'Cocos (Keeling) Islands', 'text' => 'Cocos (Keeling) Islands'], 62 | ['value' => 'Colombia', 'text' => 'Colombia'], 63 | ['value' => 'Comoros', 'text' => 'Comoros'], 64 | ['value' => 'Congo', 'text' => 'Congo'], 65 | ['value' => 'Congo, the Democratic Republic of the', 'text' => 'Congo, the Democratic Republic of the'], 66 | ['value' => 'Cook Islands', 'text' => 'Cook Islands'], 67 | ['value' => 'Costa Rica', 'text' => 'Costa Rica'], 68 | ['value' => "Cote d'Ivoire", 'text' => "Cote d'Ivoire"], 69 | ['value' => 'Croatia', 'text' => 'Croatia'], 70 | ['value' => 'Cuba', 'text' => 'Cuba'], 71 | ['value' => 'Curaçao', 'text' => 'Curaçao'], 72 | ['value' => 'Cyprus', 'text' => 'Cyprus'], 73 | ['value' => 'Czech Republic', 'text' => 'Czech Republic'], 74 | ['value' => 'Denmark', 'text' => 'Denmark'], 75 | ['value' => 'Djibouti', 'text' => 'Djibouti'], 76 | ['value' => 'Dominica', 'text' => 'Dominica'], 77 | ['value' => 'Dominican Republic', 'text' => 'Dominican Republic'], 78 | ['value' => 'Ecuador', 'text' => 'Ecuador'], 79 | ['value' => 'Egypt', 'text' => 'Egypt'], 80 | ['value' => 'El Salvador', 'text' => 'El Salvador'], 81 | ['value' => 'Equatorial Guinea', 'text' => 'Equatorial Guinea'], 82 | ['value' => 'Eritrea', 'text' => 'Eritrea'], 83 | ['value' => 'Estonia', 'text' => 'Estonia'], 84 | ['value' => 'Ethiopia', 'text' => 'Ethiopia'], 85 | ['value' => 'Falkland Islands (Malvinas)', 'text' => 'Falkland Islands (Malvinas)'], 86 | ['value' => 'Faroe Islands', 'text' => 'Faroe Islands'], 87 | ['value' => 'Fiji', 'text' => 'Fiji'], 88 | ['value' => 'Finland', 'text' => 'Finland'], 89 | ['value' => 'France', 'text' => 'France'], 90 | ['value' => 'French Guiana', 'text' => 'French Guiana'], 91 | ['value' => 'French Polynesia', 'text' => 'French Polynesia'], 92 | ['value' => 'French Southern Territories', 'text' => 'French Southern Territories'], 93 | ['value' => 'Gabon', 'text' => 'Gabon'], 94 | ['value' => 'Gambia', 'text' => 'Gambia'], 95 | ['value' => 'Georgia', 'text' => 'Georgia'], 96 | ['value' => 'Germany', 'text' => 'Germany'], 97 | ['value' => 'Ghana', 'text' => 'Ghana'], 98 | ['value' => 'Gibraltar', 'text' => 'Gibraltar'], 99 | ['value' => 'Greece', 'text' => 'Greece'], 100 | ['value' => 'Greenland', 'text' => 'Greenland'], 101 | ['value' => 'Grenada', 'text' => 'Grenada'], 102 | ['value' => 'Guadeloupe', 'text' => 'Guadeloupe'], 103 | ['value' => 'Guam', 'text' => 'Guam'], 104 | ['value' => 'Guatemala', 'text' => 'Guatemala'], 105 | ['value' => 'Guernsey', 'text' => 'Guernsey'], 106 | ['value' => 'Guinea', 'text' => 'Guinea'], 107 | ['value' => 'Guinea-Bissau', 'text' => 'Guinea-Bissau'], 108 | ['value' => 'Guyana', 'text' => 'Guyana'], 109 | ['value' => 'Haiti', 'text' => 'Haiti'], 110 | ['value' => 'Heard Island and McDonald Islands', 'text' => 'Heard Island and McDonald Islands'], 111 | ['value' => 'Holy See (Vatican City State)', 'text' => 'Holy See (Vatican City State)'], 112 | ['value' => 'Honduras', 'text' => 'Honduras'], 113 | ['value' => 'Hong Kong', 'text' => 'Hong Kong'], 114 | ['value' => 'Hungary', 'text' => 'Hungary'], 115 | ['value' => 'Iceland', 'text' => 'Iceland'], 116 | ['value' => 'India', 'text' => 'India'], 117 | ['value' => 'Indonesia', 'text' => 'Indonesia'], 118 | ['value' => 'Iran, Islamic Republic of', 'text' => 'Iran, Islamic Republic of'], 119 | ['value' => 'Iraq', 'text' => 'Iraq'], 120 | ['value' => 'Ireland', 'text' => 'Ireland'], 121 | ['value' => 'Isle of Man', 'text' => 'Isle of Man'], 122 | ['value' => 'Israel', 'text' => 'Israel'], 123 | ['value' => 'Italy', 'text' => 'Italy'], 124 | ['value' => 'Jamaica', 'text' => 'Jamaica'], 125 | ['value' => 'Japan', 'text' => 'Japan'], 126 | ['value' => 'Jersey', 'text' => 'Jersey'], 127 | ['value' => 'Jordan', 'text' => 'Jordan'], 128 | ['value' => 'Kazakhstan', 'text' => 'Kazakhstan'], 129 | ['value' => 'Kenya', 'text' => 'Kenya'], 130 | ['value' => 'Kiribati', 'text' => 'Kiribati'], 131 | ['value' => "Korea, Democratic People's Republic of", 'text' => "Korea, Democratic People's Republic of"], 132 | ['value' => 'Korea, Republic of', 'text' => 'Korea, Republic of'], 133 | ['value' => 'Kuwait', 'text' => 'Kuwait'], 134 | ['value' => 'Kyrgyzstan', 'text' => 'Kyrgyzstan'], 135 | ['value' => "Lao People's Democratic Republic", 'text' => "Lao People's Democratic Republic"], 136 | ['value' => 'Latvia', 'text' => 'Latvia'], 137 | ['value' => 'Lebanon', 'text' => 'Lebanon'], 138 | ['value' => 'Lesotho', 'text' => 'Lesotho'], 139 | ['value' => 'Liberia', 'text' => 'Liberia'], 140 | ['value' => 'Libyan Arab Jamahiriya', 'text' => 'Libyan Arab Jamahiriya'], 141 | ['value' => 'Liechtenstein', 'text' => 'Liechtenstein'], 142 | ['value' => 'Lithuania', 'text' => 'Lithuania'], 143 | ['value' => 'Luxembourg', 'text' => 'Luxembourg'], 144 | ['value' => 'Macao', 'text' => 'Macao'], 145 | ['value' => 'Macedonia', 'text' => 'Macedonia'], 146 | ['value' => 'Madagascar', 'text' => 'Madagascar'], 147 | ['value' => 'Malawi', 'text' => 'Malawi'], 148 | ['value' => 'Malaysia', 'text' => 'Malaysia'], 149 | ['value' => 'Maldives', 'text' => 'Maldives'], 150 | ['value' => 'Mali', 'text' => 'Mali'], 151 | ['value' => 'Malta', 'text' => 'Malta'], 152 | ['value' => 'Marshall Islands', 'text' => 'Marshall Islands'], 153 | ['value' => 'Martinique', 'text' => 'Martinique'], 154 | ['value' => 'Mauritania', 'text' => 'Mauritania'], 155 | ['value' => 'Mauritius', 'text' => 'Mauritius'], 156 | ['value' => 'Mayotte', 'text' => 'Mayotte'], 157 | ['value' => 'Mexico', 'text' => 'Mexico'], 158 | ['value' => 'Micronesia, Federated States of', 'text' => 'Micronesia, Federated States of'], 159 | ['value' => 'Moldova, Republic of', 'text' => 'Moldova, Republic of'], 160 | ['value' => 'Monaco', 'text' => 'Monaco'], 161 | ['value' => 'Mongolia', 'text' => 'Mongolia'], 162 | ['value' => 'Montenegro', 'text' => 'Montenegro'], 163 | ['value' => 'Montserrat', 'text' => 'Montserrat'], 164 | ['value' => 'Morocco', 'text' => 'Morocco'], 165 | ['value' => 'Mozambique', 'text' => 'Mozambique'], 166 | ['value' => 'Myanmar', 'text' => 'Myanmar'], 167 | ['value' => 'Namibia', 'text' => 'Namibia'], 168 | ['value' => 'Nauru', 'text' => 'Nauru'], 169 | ['value' => 'Nepal', 'text' => 'Nepal'], 170 | ['value' => 'Netherlands', 'text' => 'Netherlands'], 171 | ['value' => 'New Caledonia', 'text' => 'New Caledonia'], 172 | ['value' => 'New Zealand', 'text' => 'New Zealand'], 173 | ['value' => 'Nicaragua', 'text' => 'Nicaragua'], 174 | ['value' => 'Niger', 'text' => 'Niger'], 175 | ['value' => 'Nigeria', 'text' => 'Nigeria'], 176 | ['value' => 'Niue', 'text' => 'Niue'], 177 | ['value' => 'Norfolk Island', 'text' => 'Norfolk Island'], 178 | ['value' => 'Northern Mariana Islands', 'text' => 'Northern Mariana Islands'], 179 | ['value' => 'Norway', 'text' => 'Norway'], 180 | ['value' => 'Oman', 'text' => 'Oman'], 181 | ['value' => 'Pakistan', 'text' => 'Pakistan'], 182 | ['value' => 'Palau', 'text' => 'Palau'], 183 | ['value' => 'Palestinian Territory, Occupied', 'text' => 'Palestinian Territory, Occupied'], 184 | ['value' => 'Panama', 'text' => 'Panama'], 185 | ['value' => 'Papua New Guinea', 'text' => 'Papua New Guinea'], 186 | ['value' => 'Paraguay', 'text' => 'Paraguay'], 187 | ['value' => 'Peru', 'text' => 'Peru'], 188 | ['value' => 'Philippines', 'text' => 'Philippines'], 189 | ['value' => 'Pitcairn', 'text' => 'Pitcairn'], 190 | ['value' => 'Poland', 'text' => 'Poland'], 191 | ['value' => 'Portugal', 'text' => 'Portugal'], 192 | ['value' => 'Puerto Rico', 'text' => 'Puerto Rico'], 193 | ['value' => 'Qatar', 'text' => 'Qatar'], 194 | ['value' => 'Reunion', 'text' => 'Reunion'], 195 | ['value' => 'Romania', 'text' => 'Romania'], 196 | ['value' => 'Russian Federation', 'text' => 'Russian Federation'], 197 | ['value' => 'Rwanda', 'text' => 'Rwanda'], 198 | ['value' => 'Saint Barthélemy', 'text' => 'Saint Barthélemy'], 199 | ['value' => 'Saint Helena', 'text' => 'Saint Helena'], 200 | ['value' => 'Saint Kitts and Nevis', 'text' => 'Saint Kitts and Nevis'], 201 | ['value' => 'Saint Lucia', 'text' => 'Saint Lucia'], 202 | ['value' => 'Saint Martin (French part)', 'text' => 'Saint Martin (French part)'], 203 | ['value' => 'Saint Pierre and Miquelon', 'text' => 'Saint Pierre and Miquelon'], 204 | ['value' => 'Saint Vincent and the Grenadines', 'text' => 'Saint Vincent and the Grenadines'], 205 | ['value' => 'Samoa', 'text' => 'Samoa'], 206 | ['value' => 'San Marino', 'text' => 'San Marino'], 207 | ['value' => 'Sao Tome and Principe', 'text' => 'Sao Tome and Principe'], 208 | ['value' => 'Saudi Arabia', 'text' => 'Saudi Arabia'], 209 | ['value' => 'Senegal', 'text' => 'Senegal'], 210 | ['value' => 'Serbia', 'text' => 'Serbia'], 211 | ['value' => 'Seychelles', 'text' => 'Seychelles'], 212 | ['value' => 'Sierra Leone', 'text' => 'Sierra Leone'], 213 | ['value' => 'Singapore', 'text' => 'Singapore'], 214 | ['value' => 'Sint Maarten (Dutch part)', 'text' => 'Sint Maarten (Dutch part)'], 215 | ['value' => 'Slovakia', 'text' => 'Slovakia'], 216 | ['value' => 'Slovenia', 'text' => 'Slovenia'], 217 | ['value' => 'Solomon Islands', 'text' => 'Solomon Islands'], 218 | ['value' => 'Somalia', 'text' => 'Somalia'], 219 | ['value' => 'South Africa', 'text' => 'South Africa'], 220 | ['value' => 'South Georgia and the South Sandwich Islands', 'text' => 'South Georgia and the South Sandwich Islands'], 221 | ['value' => 'Spain', 'text' => 'Spain'], 222 | ['value' => 'Sri Lanka', 'text' => 'Sri Lanka'], 223 | ['value' => 'Sudan', 'text' => 'Sudan'], 224 | ['value' => 'Suritext', 'text' => 'Suritext'], 225 | ['value' => 'Svalbard and Jan Mayen', 'text' => 'Svalbard and Jan Mayen'], 226 | ['value' => 'Swaziland', 'text' => 'Swaziland'], 227 | ['value' => 'Sweden', 'text' => 'Sweden'], 228 | ['value' => 'Switzerland', 'text' => 'Switzerland'], 229 | ['value' => 'Syrian Arab Republic', 'text' => 'Syrian Arab Republic'], 230 | ['value' => 'Taiwan, Province of China', 'text' => 'Taiwan, Province of China'], 231 | ['value' => 'Tajikistan', 'text' => 'Tajikistan'], 232 | ['value' => 'Tanzania, United Republic of', 'text' => 'Tanzania, United Republic of'], 233 | ['value' => 'Thailand', 'text' => 'Thailand'], 234 | ['value' => 'Timor-Leste', 'text' => 'Timor-Leste'], 235 | ['value' => 'Togo', 'text' => 'Togo'], 236 | ['value' => 'Tokelau', 'text' => 'Tokelau'], 237 | ['value' => 'Tonga', 'text' => 'Tonga'], 238 | ['value' => 'Trinidad and Tobago', 'text' => 'Trinidad and Tobago'], 239 | ['value' => 'Tunisia', 'text' => 'Tunisia'], 240 | ['value' => 'Turkey', 'text' => 'Turkey'], 241 | ['value' => 'Turkmenistan', 'text' => 'Turkmenistan'], 242 | ['value' => 'Turks and Caicos Islands', 'text' => 'Turks and Caicos Islands'], 243 | ['value' => 'Tuvalu', 'text' => 'Tuvalu'], 244 | ['value' => 'Uganda', 'text' => 'Uganda'], 245 | ['value' => 'Ukraine', 'text' => 'Ukraine'], 246 | ['value' => 'United Arab Emirates', 'text' => 'United Arab Emirates'], 247 | ['value' => 'United Kingdom', 'text' => 'United Kingdom'], 248 | ['value' => 'United States Minor Outlying Islands', 'text' => 'United States Minor Outlying Islands'], 249 | ['value' => 'United States', 'text' => 'United States'], 250 | ['value' => 'Uruguay', 'text' => 'Uruguay'], 251 | ['value' => 'Uzbekistan', 'text' => 'Uzbekistan'], 252 | ['value' => 'Vanuatu', 'text' => 'Vanuatu'], 253 | ['value' => 'Venezuela, Bolivarian Republic of', 'text' => 'Venezuela, Bolivarian Republic of'], 254 | ['value' => 'Viet Nam', 'text' => 'Viet Nam'], 255 | ['value' => 'Virgin Islands, British', 'text' => 'Virgin Islands, British'], 256 | ['value' => 'Virgin Islands, U.S.', 'text' => 'Virgin Islands, U.S.'], 257 | ['value' => 'Wallis and Futuna', 'text' => 'Wallis and Futuna'], 258 | ['value' => 'Western Sahara', 'text' => 'Western Sahara'], 259 | ['value' => 'Yemen', 'text' => 'Yemen'], 260 | ['value' => 'Zambia', 'text' => 'Zambia'], 261 | ['value' => 'Zimbabwe', 'text' => 'Zimbabwe'], 262 | ]; 263 | 264 | // ISO 3166-1 alpha-2 265 | $countries_iso2 = [ 266 | ['value' => 'AD', 'text' => 'AD - Andorra'], 267 | ['value' => 'AE', 'text' => 'AE - United Arab Emirates'], 268 | ['value' => 'AF', 'text' => 'AF - Afghanistan'], 269 | ['value' => 'AG', 'text' => 'AG - Antigua and Barbuda'], 270 | ['value' => 'AI', 'text' => 'AI - Anguilla'], 271 | ['value' => 'AL', 'text' => 'AL - Albania'], 272 | ['value' => 'AM', 'text' => 'AM - Armenia'], 273 | ['value' => 'AO', 'text' => 'AO - Angola'], 274 | ['value' => 'AQ', 'text' => 'AQ - Antarctica'], 275 | ['value' => 'AR', 'text' => 'AR - Argentina'], 276 | ['value' => 'AS', 'text' => 'AS - American Samoa'], 277 | ['value' => 'AT', 'text' => 'AT - Austria'], 278 | ['value' => 'AU', 'text' => 'AU - Australia'], 279 | ['value' => 'AW', 'text' => 'AW - Aruba'], 280 | ['value' => 'AX', 'text' => 'AX - Aland Islands '], 281 | ['value' => 'AZ', 'text' => 'AZ - Azerbaijan'], 282 | ['value' => 'BA', 'text' => 'BA - Bosnia and Herzegovina'], 283 | ['value' => 'BB', 'text' => 'BB - Barbados'], 284 | ['value' => 'BD', 'text' => 'BD - Bangladesh'], 285 | ['value' => 'BE', 'text' => 'BE - Belgium'], 286 | ['value' => 'BF', 'text' => 'BF - Burkina Faso'], 287 | ['value' => 'BG', 'text' => 'BG - Bulgaria'], 288 | ['value' => 'BH', 'text' => 'BH - Bahrain'], 289 | ['value' => 'BI', 'text' => 'BI - Burundi'], 290 | ['value' => 'BJ', 'text' => 'BJ - Benin'], 291 | ['value' => 'BL', 'text' => 'BL - Saint Barthélemy'], 292 | ['value' => 'BM', 'text' => 'BM - Bermuda'], 293 | ['value' => 'BN', 'text' => 'BN - Brunei Darussalam'], 294 | ['value' => 'BO', 'text' => 'BO - Bolivia, Plurinational State of'], 295 | ['value' => 'BQ', 'text' => 'BQ - Bonaire, Sint Eustatius and Saba'], 296 | ['value' => 'BR', 'text' => 'BR - Brazil'], 297 | ['value' => 'BS', 'text' => 'BS - Bahamas'], 298 | ['value' => 'BT', 'text' => 'BT - Bhutan'], 299 | ['value' => 'BV', 'text' => 'BV - Bouvet Island'], 300 | ['value' => 'BW', 'text' => 'BW - Botswana'], 301 | ['value' => 'BY', 'text' => 'BY - Belarus'], 302 | ['value' => 'BZ', 'text' => 'BZ - Belize'], 303 | ['value' => 'CA', 'text' => 'CA - Canada'], 304 | ['value' => 'CC', 'text' => 'CC - Cocos (Keeling) Islands'], 305 | ['value' => 'CD', 'text' => 'CD - Congo, the Democratic Republic of the'], 306 | ['value' => 'CF', 'text' => 'CF - Central African Republic'], 307 | ['value' => 'CG', 'text' => 'CG - Congo'], 308 | ['value' => 'CH', 'text' => 'CH - Switzerland'], 309 | ['value' => 'CI', 'text' => "CI - Cote d'Ivoire"], 310 | ['value' => 'CK', 'text' => 'CK - Cook Islands'], 311 | ['value' => 'CL', 'text' => 'CL - Chile'], 312 | ['value' => 'CM', 'text' => 'CM - Cameroon'], 313 | ['value' => 'CN', 'text' => 'CN - China'], 314 | ['value' => 'CO', 'text' => 'CO - Colombia'], 315 | ['value' => 'CR', 'text' => 'CR - Costa Rica'], 316 | ['value' => 'CU', 'text' => 'CU - Cuba'], 317 | ['value' => 'CV', 'text' => 'CV - Cape Verde'], 318 | ['value' => 'CW', 'text' => 'CW - Curaçao'], 319 | ['value' => 'CX', 'text' => 'CX - Christmas Island'], 320 | ['value' => 'CY', 'text' => 'CY - Cyprus'], 321 | ['value' => 'CZ', 'text' => 'CZ - Czech Republic'], 322 | ['value' => 'DE', 'text' => 'DE - Germany'], 323 | ['value' => 'DJ', 'text' => 'DJ - Djibouti'], 324 | ['value' => 'DK', 'text' => 'DK - Denmark'], 325 | ['value' => 'DM', 'text' => 'DM - Dominica'], 326 | ['value' => 'DO', 'text' => 'DO - Dominican Republic'], 327 | ['value' => 'DZ', 'text' => 'DZ - Algeria'], 328 | ['value' => 'EC', 'text' => 'EC - Ecuador'], 329 | ['value' => 'EE', 'text' => 'EE - Estonia'], 330 | ['value' => 'EG', 'text' => 'EG - Egypt'], 331 | ['value' => 'EH', 'text' => 'EH - Western Sahara'], 332 | ['value' => 'ER', 'text' => 'ER - Eritrea'], 333 | ['value' => 'ES', 'text' => 'ES - Spain'], 334 | ['value' => 'ET', 'text' => 'ET - Ethiopia'], 335 | ['value' => 'FI', 'text' => 'FI - Finland'], 336 | ['value' => 'FJ', 'text' => 'FJ - Fiji'], 337 | ['value' => 'FK', 'text' => 'FK - Falkland Islands (Malvinas)'], 338 | ['value' => 'FM', 'text' => 'FM - Micronesia, Federated States of'], 339 | ['value' => 'FO', 'text' => 'FO - Faroe Islands'], 340 | ['value' => 'FR', 'text' => 'FR - France'], 341 | ['value' => 'GA', 'text' => 'GA - Gabon'], 342 | ['value' => 'GB', 'text' => 'GB - United Kingdom'], 343 | ['value' => 'GD', 'text' => 'GD - Grenada'], 344 | ['value' => 'GE', 'text' => 'GE - Georgia'], 345 | ['value' => 'GF', 'text' => 'GF - French Guiana'], 346 | ['value' => 'GG', 'text' => 'GG - Guernsey'], 347 | ['value' => 'GH', 'text' => 'GH - Ghana'], 348 | ['value' => 'GI', 'text' => 'GI - Gibraltar'], 349 | ['value' => 'GL', 'text' => 'GL - Greenland'], 350 | ['value' => 'GM', 'text' => 'GM - Gambia'], 351 | ['value' => 'GN', 'text' => 'GN - Guinea'], 352 | ['value' => 'GP', 'text' => 'GP - Guadeloupe'], 353 | ['value' => 'GQ', 'text' => 'GQ - Equatorial Guinea'], 354 | ['value' => 'GR', 'text' => 'GR - Greece'], 355 | ['value' => 'GS', 'text' => 'GS - South Georgia and the South Sandwich Islands'], 356 | ['value' => 'GT', 'text' => 'GT - Guatemala'], 357 | ['value' => 'GU', 'text' => 'GU - Guam'], 358 | ['value' => 'GW', 'text' => 'GW - Guinea-Bissau'], 359 | ['value' => 'GY', 'text' => 'GY - Guyana'], 360 | ['value' => 'HK', 'text' => 'HK - Hong Kong'], 361 | ['value' => 'HM', 'text' => 'HM - Heard Island and McDonald Islands'], 362 | ['value' => 'HN', 'text' => 'HN - Honduras'], 363 | ['value' => 'HR', 'text' => 'HR - Croatia'], 364 | ['value' => 'HT', 'text' => 'HT - Haiti'], 365 | ['value' => 'HU', 'text' => 'HU - Hungary'], 366 | ['value' => 'ID', 'text' => 'ID - Indonesia'], 367 | ['value' => 'IE', 'text' => 'IE - Ireland'], 368 | ['value' => 'IL', 'text' => 'IL - Israel'], 369 | ['value' => 'IM', 'text' => 'IM - Isle of Man'], 370 | ['value' => 'IN', 'text' => 'IN - India'], 371 | ['value' => 'IO', 'text' => 'IO - British Indian Ocean Territory'], 372 | ['value' => 'IQ', 'text' => 'IQ - Iraq'], 373 | ['value' => 'IR', 'text' => 'IR - Iran, Islamic Republic of'], 374 | ['value' => 'IS', 'text' => 'IS - Iceland'], 375 | ['value' => 'IT', 'text' => 'IT - Italy'], 376 | ['value' => 'JE', 'text' => 'JE - Jersey'], 377 | ['value' => 'JM', 'text' => 'JM - Jamaica'], 378 | ['value' => 'JO', 'text' => 'JO - Jordan'], 379 | ['value' => 'JP', 'text' => 'JP - Japan'], 380 | ['value' => 'KE', 'text' => 'KE - Kenya'], 381 | ['value' => 'KG', 'text' => 'KG - Kyrgyzstan'], 382 | ['value' => 'KH', 'text' => 'KH - Cambodia'], 383 | ['value' => 'KI', 'text' => 'KI - Kiribati'], 384 | ['value' => 'KM', 'text' => 'KM - Comoros'], 385 | ['value' => 'KN', 'text' => 'KN - Saint Kitts and Nevis'], 386 | ['value' => 'KP', 'text' => "KP - Korea, Democratic People's Republic of"], 387 | ['value' => 'KR', 'text' => 'KR - Korea, Republic of'], 388 | ['value' => 'KW', 'text' => 'KW - Kuwait'], 389 | ['value' => 'KY', 'text' => 'KY - Cayman Islands'], 390 | ['value' => 'KZ', 'text' => 'KZ - Kazakhstan'], 391 | ['value' => 'LA', 'text' => "LA - Lao People's Democratic Republic"], 392 | ['value' => 'LB', 'text' => 'LB - Lebanon'], 393 | ['value' => 'LC', 'text' => 'LC - Saint Lucia'], 394 | ['value' => 'LI', 'text' => 'LI - Liechtenstein'], 395 | ['value' => 'LK', 'text' => 'LK - Sri Lanka'], 396 | ['value' => 'LR', 'text' => 'LR - Liberia'], 397 | ['value' => 'LS', 'text' => 'LS - Lesotho'], 398 | ['value' => 'LT', 'text' => 'LT - Lithuania'], 399 | ['value' => 'LU', 'text' => 'LU - Luxembourg'], 400 | ['value' => 'LV', 'text' => 'LV - Latvia'], 401 | ['value' => 'LY', 'text' => 'LY - Libyan Arab Jamahiriya'], 402 | ['value' => 'MA', 'text' => 'MA - Morocco'], 403 | ['value' => 'MC', 'text' => 'MC - Monaco'], 404 | ['value' => 'MD', 'text' => 'MD - Moldova, Republic of'], 405 | ['value' => 'ME', 'text' => 'ME - Montenegro'], 406 | ['value' => 'MF', 'text' => 'MF - Saint Martin (French part)'], 407 | ['value' => 'MG', 'text' => 'MG - Madagascar'], 408 | ['value' => 'MH', 'text' => 'MH - Marshall Islands'], 409 | ['value' => 'MK', 'text' => 'MK - Macedonia'], 410 | ['value' => 'ML', 'text' => 'ML - Mali'], 411 | ['value' => 'MM', 'text' => 'MM - Myanmar'], 412 | ['value' => 'MN', 'text' => 'MN - Mongolia'], 413 | ['value' => 'MO', 'text' => 'MO - Macao'], 414 | ['value' => 'MP', 'text' => 'MP - Northern Mariana Islands'], 415 | ['value' => 'MQ', 'text' => 'MQ - Martinique'], 416 | ['value' => 'MR', 'text' => 'MR - Mauritania'], 417 | ['value' => 'MS', 'text' => 'MS - Montserrat'], 418 | ['value' => 'MT', 'text' => 'MT - Malta'], 419 | ['value' => 'MU', 'text' => 'MU - Mauritius'], 420 | ['value' => 'MV', 'text' => 'MV - Maldives'], 421 | ['value' => 'MW', 'text' => 'MW - Malawi'], 422 | ['value' => 'MX', 'text' => 'MX - Mexico'], 423 | ['value' => 'MY', 'text' => 'MY - Malaysia'], 424 | ['value' => 'MZ', 'text' => 'MZ - Mozambique'], 425 | ['value' => 'NA', 'text' => 'NA - Namibia'], 426 | ['value' => 'NC', 'text' => 'NC - New Caledonia'], 427 | ['value' => 'NE', 'text' => 'NE - Niger'], 428 | ['value' => 'NF', 'text' => 'NF - Norfolk Island'], 429 | ['value' => 'NG', 'text' => 'NG - Nigeria'], 430 | ['value' => 'NI', 'text' => 'NI - Nicaragua'], 431 | ['value' => 'NL', 'text' => 'NL - Netherlands'], 432 | ['value' => 'NO', 'text' => 'NO - Norway'], 433 | ['value' => 'NP', 'text' => 'NP - Nepal'], 434 | ['value' => 'NR', 'text' => 'NR - Nauru'], 435 | ['value' => 'NU', 'text' => 'NU - Niue'], 436 | ['value' => 'NZ', 'text' => 'NZ - New Zealand'], 437 | ['value' => 'OM', 'text' => 'OM - Oman'], 438 | ['value' => 'PA', 'text' => 'PA - Panama'], 439 | ['value' => 'PE', 'text' => 'PE - Peru'], 440 | ['value' => 'PF', 'text' => 'PF - French Polynesia'], 441 | ['value' => 'PG', 'text' => 'PG - Papua New Guinea'], 442 | ['value' => 'PH', 'text' => 'PH - Philippines'], 443 | ['value' => 'PK', 'text' => 'PK - Pakistan'], 444 | ['value' => 'PL', 'text' => 'PL - Poland'], 445 | ['value' => 'PM', 'text' => 'PM - Saint Pierre and Miquelon'], 446 | ['value' => 'PN', 'text' => 'PN - Pitcairn'], 447 | ['value' => 'PR', 'text' => 'PR - Puerto Rico'], 448 | ['value' => 'PS', 'text' => 'PS - Palestinian Territory, Occupied'], 449 | ['value' => 'PT', 'text' => 'PT - Portugal'], 450 | ['value' => 'PW', 'text' => 'PW - Palau'], 451 | ['value' => 'PY', 'text' => 'PY - Paraguay'], 452 | ['value' => 'QA', 'text' => 'QA - Qatar'], 453 | ['value' => 'RE', 'text' => 'RE - Reunion'], 454 | ['value' => 'RO', 'text' => 'RO - Romania'], 455 | ['value' => 'RS', 'text' => 'RS - Serbia'], 456 | ['value' => 'RU', 'text' => 'RU - Russian Federation'], 457 | ['value' => 'RW', 'text' => 'RW - Rwanda'], 458 | ['value' => 'SA', 'text' => 'SA - Saudi Arabia'], 459 | ['value' => 'SB', 'text' => 'SB - Solomon Islands'], 460 | ['value' => 'SC', 'text' => 'SC - Seychelles'], 461 | ['value' => 'SD', 'text' => 'SD - Sudan'], 462 | ['value' => 'SE', 'text' => 'SE - Sweden'], 463 | ['value' => 'SG', 'text' => 'SG - Singapore'], 464 | ['value' => 'SH', 'text' => 'SH - Saint Helena'], 465 | ['value' => 'SI', 'text' => 'SI - Slovenia'], 466 | ['value' => 'SJ', 'text' => 'SJ - Svalbard and Jan Mayen'], 467 | ['value' => 'SK', 'text' => 'SK - Slovakia'], 468 | ['value' => 'SL', 'text' => 'SL - Sierra Leone'], 469 | ['value' => 'SM', 'text' => 'SM - San Marino'], 470 | ['value' => 'SN', 'text' => 'SN - Senegal'], 471 | ['value' => 'SO', 'text' => 'SO - Somalia'], 472 | ['value' => 'SR', 'text' => 'SR - Suritext'], 473 | ['value' => 'ST', 'text' => 'ST - Sao Tome and Principe'], 474 | ['value' => 'SV', 'text' => 'SV - El Salvador'], 475 | ['value' => 'SX', 'text' => 'SX - Sint Maarten (Dutch part)'], 476 | ['value' => 'SY', 'text' => 'SY - Syrian Arab Republic'], 477 | ['value' => 'SZ', 'text' => 'SZ - Swaziland'], 478 | ['value' => 'TC', 'text' => 'TC - Turks and Caicos Islands'], 479 | ['value' => 'TD', 'text' => 'TD - Chad'], 480 | ['value' => 'TF', 'text' => 'TF - French Southern Territories'], 481 | ['value' => 'TG', 'text' => 'TG - Togo'], 482 | ['value' => 'TH', 'text' => 'TH - Thailand'], 483 | ['value' => 'TJ', 'text' => 'TJ - Tajikistan'], 484 | ['value' => 'TK', 'text' => 'TK - Tokelau'], 485 | ['value' => 'TL', 'text' => 'TL - Timor-Leste'], 486 | ['value' => 'TM', 'text' => 'TM - Turkmenistan'], 487 | ['value' => 'TN', 'text' => 'TN - Tunisia'], 488 | ['value' => 'TO', 'text' => 'TO - Tonga'], 489 | ['value' => 'TR', 'text' => 'TR - Turkey'], 490 | ['value' => 'TT', 'text' => 'TT - Trinidad and Tobago'], 491 | ['value' => 'TV', 'text' => 'TV - Tuvalu'], 492 | ['value' => 'TW', 'text' => 'TW - Taiwan, Province of China'], 493 | ['value' => 'TZ', 'text' => 'TZ - Tanzania, United Republic of'], 494 | ['value' => 'UA', 'text' => 'UA - Ukraine'], 495 | ['value' => 'UG', 'text' => 'UG - Uganda'], 496 | ['value' => 'UM', 'text' => 'UM - United States Minor Outlying Islands'], 497 | ['value' => 'US', 'text' => 'US - United States'], 498 | ['value' => 'UY', 'text' => 'UY - Uruguay'], 499 | ['value' => 'UZ', 'text' => 'UZ - Uzbekistan'], 500 | ['value' => 'VA', 'text' => 'VA - Holy See (Vatican City State)'], 501 | ['value' => 'VC', 'text' => 'VC - Saint Vincent and the Grenadines'], 502 | ['value' => 'VE', 'text' => 'VE - Venezuela, Bolivarian Republic of'], 503 | ['value' => 'VG', 'text' => 'VG - Virgin Islands, British'], 504 | ['value' => 'VI', 'text' => 'VI - Virgin Islands, U.S.'], 505 | ['value' => 'VN', 'text' => 'VN - Viet Nam'], 506 | ['value' => 'VU', 'text' => 'VU - Vanuatu'], 507 | ['value' => 'WF', 'text' => 'WF - Wallis and Futuna'], 508 | ['value' => 'WS', 'text' => 'WS - Samoa'], 509 | ['value' => 'YE', 'text' => 'YE - Yemen'], 510 | ['value' => 'YT', 'text' => 'YT - Mayotte'], 511 | ['value' => 'ZA', 'text' => 'ZA - South Africa'], 512 | ['value' => 'ZM', 'text' => 'ZM - Zambia'], 513 | ['value' => 'ZW', 'text' => 'ZW - Zimbabwe'], 514 | ]; 515 | 516 | // ISO 3166-1 alpha 3 517 | $countries_iso3 = [ 518 | ['value' => 'ABW', 'text' => 'ABW - Aruba'], 519 | ['value' => 'AFG', 'text' => 'AFG - Afghanistan'], 520 | ['value' => 'AGO', 'text' => 'AGO - Angola'], 521 | ['value' => 'AIA', 'text' => 'AIA - Anguilla'], 522 | ['value' => 'ALA', 'text' => 'ALA - Åland Islands'], 523 | ['value' => 'ALB', 'text' => 'ALB - Albania'], 524 | ['value' => 'AND', 'text' => 'AND - Andorra'], 525 | ['value' => 'ARE', 'text' => 'ARE - United Arab Emirates'], 526 | ['value' => 'ARG', 'text' => 'ARG - Argentina'], 527 | ['value' => 'ARM', 'text' => 'ARM - Armenia'], 528 | ['value' => 'ASM', 'text' => 'ASM - American Samoa'], 529 | ['value' => 'ATA', 'text' => 'ATA - Antarctica'], 530 | ['value' => 'ATF', 'text' => 'ATF - French Southern Territories'], 531 | ['value' => 'ATG', 'text' => 'ATG - Antigua and Barbuda'], 532 | ['value' => 'AUS', 'text' => 'AUS - Australia'], 533 | ['value' => 'AUT', 'text' => 'AUT - Austria'], 534 | ['value' => 'AZE', 'text' => 'AZE - Azerbaijan'], 535 | ['value' => 'BDI', 'text' => 'BDI - Burundi'], 536 | ['value' => 'BEL', 'text' => 'BEL - Belgium'], 537 | ['value' => 'BEN', 'text' => 'BEN - Benin'], 538 | ['value' => 'BES', 'text' => 'BES - Bonaire, Sint Eustatius and Saba'], 539 | ['value' => 'BFA', 'text' => 'BFA - Burkina Faso'], 540 | ['value' => 'BGD', 'text' => 'BGD - Bangladesh'], 541 | ['value' => 'BGR', 'text' => 'BGR - Bulgaria'], 542 | ['value' => 'BHR', 'text' => 'BHR - Bahrain'], 543 | ['value' => 'BHS', 'text' => 'BHS - Bahamas'], 544 | ['value' => 'BIH', 'text' => 'BIH - Bosnia and Herzegovina'], 545 | ['value' => 'BLM', 'text' => 'BLM - Saint Barthélemy'], 546 | ['value' => 'BLR', 'text' => 'BLR - Belarus'], 547 | ['value' => 'BLZ', 'text' => 'BLZ - Belize'], 548 | ['value' => 'BMU', 'text' => 'BMU - Bermuda'], 549 | ['value' => 'BOL', 'text' => 'BOL - Bolivia, Plurinational State of'], 550 | ['value' => 'BRA', 'text' => 'BRA - Brazil'], 551 | ['value' => 'BRB', 'text' => 'BRB - Barbados'], 552 | ['value' => 'BRN', 'text' => 'BRN - Brunei Darussalam'], 553 | ['value' => 'BTN', 'text' => 'BTN - Bhutan'], 554 | ['value' => 'BVT', 'text' => 'BVT - Bouvet Island'], 555 | ['value' => 'BWA', 'text' => 'BWA - Botswana'], 556 | ['value' => 'CAF', 'text' => 'CAF - Central African Republic'], 557 | ['value' => 'CAN', 'text' => 'CAN - Canada'], 558 | ['value' => 'CCK', 'text' => 'CCK - Cocos (Keeling) Islands'], 559 | ['value' => 'CHE', 'text' => 'CHE - Switzerland'], 560 | ['value' => 'CHL', 'text' => 'CHL - Chile'], 561 | ['value' => 'CHN', 'text' => 'CHN - China'], 562 | ['value' => 'CIV', 'text' => "CIV - Côte d'Ivoire"], 563 | ['value' => 'CMR', 'text' => 'CMR - Cameroon'], 564 | ['value' => 'COD', 'text' => 'COD - Congo, the Democratic Republic of the'], 565 | ['value' => 'COG', 'text' => 'COG - Congo'], 566 | ['value' => 'COK', 'text' => 'COK - Cook Islands'], 567 | ['value' => 'COL', 'text' => 'COL - Colombia'], 568 | ['value' => 'COM', 'text' => 'COM - Comoros'], 569 | ['value' => 'CPV', 'text' => 'CPV - Cape Verde'], 570 | ['value' => 'CRI', 'text' => 'CRI - Costa Rica'], 571 | ['value' => 'CUB', 'text' => 'CUB - Cuba'], 572 | ['value' => 'CUW', 'text' => 'CUW - Curaçao'], 573 | ['value' => 'CXR', 'text' => 'CXR - Christmas Island'], 574 | ['value' => 'CYM', 'text' => 'CYM - Cayman Islands'], 575 | ['value' => 'CYP', 'text' => 'CYP - Cyprus'], 576 | ['value' => 'CZE', 'text' => 'CZE - Czech Republic'], 577 | ['value' => 'DEU', 'text' => 'DEU - Germany'], 578 | ['value' => 'DJI', 'text' => 'DJI - Djibouti'], 579 | ['value' => 'DMA', 'text' => 'DMA - Dominica'], 580 | ['value' => 'DNK', 'text' => 'DNK - Denmark'], 581 | ['value' => 'DOM', 'text' => 'DOM - Dominican Republic'], 582 | ['value' => 'DZA', 'text' => 'DZA - Algeria'], 583 | ['value' => 'ECU', 'text' => 'ECU - Ecuador'], 584 | ['value' => 'EGY', 'text' => 'EGY - Egypt'], 585 | ['value' => 'ERI', 'text' => 'ERI - Eritrea'], 586 | ['value' => 'ESH', 'text' => 'ESH - Western Sahara'], 587 | ['value' => 'ESP', 'text' => 'ESP - Spain'], 588 | ['value' => 'EST', 'text' => 'EST - Estonia'], 589 | ['value' => 'ETH', 'text' => 'ETH - Ethiopia'], 590 | ['value' => 'FIN', 'text' => 'FIN - Finland'], 591 | ['value' => 'FJI', 'text' => 'FJI - Fiji'], 592 | ['value' => 'FLK', 'text' => 'FLK - Falkland Islands (Malvinas)'], 593 | ['value' => 'FRA', 'text' => 'FRA - France'], 594 | ['value' => 'FRO', 'text' => 'FRO - Faroe Islands'], 595 | ['value' => 'FSM', 'text' => 'FSM - Micronesia, Federated States of'], 596 | ['value' => 'GAB', 'text' => 'GAB - Gabon'], 597 | ['value' => 'GBR', 'text' => 'GBR - United Kingdom'], 598 | ['value' => 'GEO', 'text' => 'GEO - Georgia'], 599 | ['value' => 'GGY', 'text' => 'GGY - Guernsey'], 600 | ['value' => 'GHA', 'text' => 'GHA - Ghana'], 601 | ['value' => 'GIB', 'text' => 'GIB - Gibraltar'], 602 | ['value' => 'GIN', 'text' => 'GIN - Guinea'], 603 | ['value' => 'GLP', 'text' => 'GLP - Guadeloupe'], 604 | ['value' => 'GMB', 'text' => 'GMB - Gambia'], 605 | ['value' => 'GNB', 'text' => 'GNB - Guinea-Bissau'], 606 | ['value' => 'GNQ', 'text' => 'GNQ - Equatorial Guinea'], 607 | ['value' => 'GRC', 'text' => 'GRC - Greece'], 608 | ['value' => 'GRD', 'text' => 'GRD - Grenada'], 609 | ['value' => 'GRL', 'text' => 'GRL - Greenland'], 610 | ['value' => 'GTM', 'text' => 'GTM - Guatemala'], 611 | ['value' => 'GUF', 'text' => 'GUF - French Guiana'], 612 | ['value' => 'GUM', 'text' => 'GUM - Guam'], 613 | ['value' => 'GUY', 'text' => 'GUY - Guyana'], 614 | ['value' => 'HKG', 'text' => 'HKG - Hong Kong'], 615 | ['value' => 'HMD', 'text' => 'HMD - Heard Island and McDonald Islands'], 616 | ['value' => 'HND', 'text' => 'HND - Honduras'], 617 | ['value' => 'HRV', 'text' => 'HRV - Croatia'], 618 | ['value' => 'HTI', 'text' => 'HTI - Haiti'], 619 | ['value' => 'HUN', 'text' => 'HUN - Hungary'], 620 | ['value' => 'IDN', 'text' => 'IDN - Indonesia'], 621 | ['value' => 'IMN', 'text' => 'IMN - Isle of Man'], 622 | ['value' => 'IND', 'text' => 'IND - India'], 623 | ['value' => 'IOT', 'text' => 'IOT - British Indian Ocean Territory'], 624 | ['value' => 'IRL', 'text' => 'IRL - Ireland'], 625 | ['value' => 'IRN', 'text' => 'IRN - Iran, Islamic Republic of'], 626 | ['value' => 'IRQ', 'text' => 'IRQ - Iraq'], 627 | ['value' => 'ISL', 'text' => 'ISL - Iceland'], 628 | ['value' => 'ISR', 'text' => 'ISR - Israel'], 629 | ['value' => 'ITA', 'text' => 'ITA - Italy'], 630 | ['value' => 'JAM', 'text' => 'JAM - Jamaica'], 631 | ['value' => 'JEY', 'text' => 'JEY - Jersey'], 632 | ['value' => 'JOR', 'text' => 'JOR - Jordan'], 633 | ['value' => 'JPN', 'text' => 'JPN - Japan'], 634 | ['value' => 'KAZ', 'text' => 'KAZ - Kazakhstan'], 635 | ['value' => 'KEN', 'text' => 'KEN - Kenya'], 636 | ['value' => 'KGZ', 'text' => 'KGZ - Kyrgyzstan'], 637 | ['value' => 'KHM', 'text' => 'KHM - Cambodia'], 638 | ['value' => 'KIR', 'text' => 'KIR - Kiribati'], 639 | ['value' => 'KNA', 'text' => 'KNA - Saint Kitts and Nevis'], 640 | ['value' => 'KOR', 'text' => 'KOR - Korea, Republic of'], 641 | ['value' => 'KWT', 'text' => 'KWT - Kuwait'], 642 | ['value' => 'LAO', 'text' => "LAO - Lao People's Democratic Republic"], 643 | ['value' => 'LBN', 'text' => 'LBN - Lebanon'], 644 | ['value' => 'LBR', 'text' => 'LBR - Liberia'], 645 | ['value' => 'LBY', 'text' => 'LBY - Libya'], 646 | ['value' => 'LCA', 'text' => 'LCA - Saint Lucia'], 647 | ['value' => 'LIE', 'text' => 'LIE - Liechtenstein'], 648 | ['value' => 'LKA', 'text' => 'LKA - Sri Lanka'], 649 | ['value' => 'LSO', 'text' => 'LSO - Lesotho'], 650 | ['value' => 'LTU', 'text' => 'LTU - Lithuania'], 651 | ['value' => 'LUX', 'text' => 'LUX - Luxembourg'], 652 | ['value' => 'LVA', 'text' => 'LVA - Latvia'], 653 | ['value' => 'MAC', 'text' => 'MAC - Macao'], 654 | ['value' => 'MAF', 'text' => 'MAF - Saint Martin (French part)'], 655 | ['value' => 'MAR', 'text' => 'MAR - Morocco'], 656 | ['value' => 'MCO', 'text' => 'MCO - Monaco'], 657 | ['value' => 'MDA', 'text' => 'MDA - Moldova, Republic of'], 658 | ['value' => 'MDG', 'text' => 'MDG - Madagascar'], 659 | ['value' => 'MDV', 'text' => 'MDV - Maldives'], 660 | ['value' => 'MEX', 'text' => 'MEX - Mexico'], 661 | ['value' => 'MHL', 'text' => 'MHL - Marshall Islands'], 662 | ['value' => 'MKD', 'text' => 'MKD - Macedonia, the former Yugoslav Republic of'], 663 | ['value' => 'MLI', 'text' => 'MLI - Mali'], 664 | ['value' => 'MLT', 'text' => 'MLT - Malta'], 665 | ['value' => 'MMR', 'text' => 'MMR - Myanmar'], 666 | ['value' => 'MNE', 'text' => 'MNE - Montenegro'], 667 | ['value' => 'MNG', 'text' => 'MNG - Mongolia'], 668 | ['value' => 'MNP', 'text' => 'MNP - Northern Mariana Islands'], 669 | ['value' => 'MOZ', 'text' => 'MOZ - Mozambique'], 670 | ['value' => 'MRT', 'text' => 'MRT - Mauritania'], 671 | ['value' => 'MSR', 'text' => 'MSR - Montserrat'], 672 | ['value' => 'MTQ', 'text' => 'MTQ - Martinique'], 673 | ['value' => 'MUS', 'text' => 'MUS - Mauritius'], 674 | ['value' => 'MWI', 'text' => 'MWI - Malawi'], 675 | ['value' => 'MYS', 'text' => 'MYS - Malaysia'], 676 | ['value' => 'MYT', 'text' => 'MYT - Mayotte'], 677 | ['value' => 'NAM', 'text' => 'NAM - Namibia'], 678 | ['value' => 'NCL', 'text' => 'NCL - New Caledonia'], 679 | ['value' => 'NER', 'text' => 'NER - Niger'], 680 | ['value' => 'NFK', 'text' => 'NFK - Norfolk Island'], 681 | ['value' => 'NGA', 'text' => 'NGA - Nigeria'], 682 | ['value' => 'NIC', 'text' => 'NIC - Nicaragua'], 683 | ['value' => 'NIU', 'text' => 'NIU - Niue'], 684 | ['value' => 'NLD', 'text' => 'NLD - Netherlands'], 685 | ['value' => 'NOR', 'text' => 'NOR - Norway'], 686 | ['value' => 'NPL', 'text' => 'NPL - Nepal'], 687 | ['value' => 'NRU', 'text' => 'NRU - Nauru'], 688 | ['value' => 'NZL', 'text' => 'NZL - New Zealand'], 689 | ['value' => 'OMN', 'text' => 'OMN - Oman'], 690 | ['value' => 'PAK', 'text' => 'PAK - Pakistan'], 691 | ['value' => 'PAN', 'text' => 'PAN - Panama'], 692 | ['value' => 'PCN', 'text' => 'PCN - Pitcairn'], 693 | ['value' => 'PER', 'text' => 'PER - Peru'], 694 | ['value' => 'PHL', 'text' => 'PHL - Philippines'], 695 | ['value' => 'PLW', 'text' => 'PLW - Palau'], 696 | ['value' => 'PNG', 'text' => 'PNG - Papua New Guinea'], 697 | ['value' => 'POL', 'text' => 'POL - Poland'], 698 | ['value' => 'PRI', 'text' => 'PRI - Puerto Rico'], 699 | ['value' => 'PRK', 'text' => "PRK - Korea, Democratic People's Republic of"], 700 | ['value' => 'PRT', 'text' => 'PRT - Portugal'], 701 | ['value' => 'PRY', 'text' => 'PRY - Paraguay'], 702 | ['value' => 'PSE', 'text' => 'PSE - Palestinian Territory, Occupied'], 703 | ['value' => 'PYF', 'text' => 'PYF - French Polynesia'], 704 | ['value' => 'QAT', 'text' => 'QAT - Qatar'], 705 | ['value' => 'REU', 'text' => 'REU - Réunion'], 706 | ['value' => 'ROU', 'text' => 'ROU - Romania'], 707 | ['value' => 'RUS', 'text' => 'RUS - Russian Federation'], 708 | ['value' => 'RWA', 'text' => 'RWA - Rwanda'], 709 | ['value' => 'SAU', 'text' => 'SAU - Saudi Arabia'], 710 | ['value' => 'SDN', 'text' => 'SDN - Sudan'], 711 | ['value' => 'SEN', 'text' => 'SEN - Senegal'], 712 | ['value' => 'SGP', 'text' => 'SGP - Singapore'], 713 | ['value' => 'SGS', 'text' => 'SGS - South Georgia and the South Sandwich Islands'], 714 | ['value' => 'SHN', 'text' => 'SHN - Saint Helena, Ascension and Tristan da Cunha'], 715 | ['value' => 'SJM', 'text' => 'SJM - Svalbard and Jan Mayen'], 716 | ['value' => 'SLB', 'text' => 'SLB - Solomon Islands'], 717 | ['value' => 'SLE', 'text' => 'SLE - Sierra Leone'], 718 | ['value' => 'SLV', 'text' => 'SLV - El Salvador'], 719 | ['value' => 'SMR', 'text' => 'SMR - San Marino'], 720 | ['value' => 'SOM', 'text' => 'SOM - Somalia'], 721 | ['value' => 'SPM', 'text' => 'SPM - Saint Pierre and Miquelon'], 722 | ['value' => 'SRB', 'text' => 'SRB - Serbia'], 723 | ['value' => 'SSD', 'text' => 'SSD - South Sudan'], 724 | ['value' => 'STP', 'text' => 'STP - Sao Tome and Principe'], 725 | ['value' => 'SUR', 'text' => 'SUR - Suriname'], 726 | ['value' => 'SVK', 'text' => 'SVK - Slovakia'], 727 | ['value' => 'SVN', 'text' => 'SVN - Slovenia'], 728 | ['value' => 'SWE', 'text' => 'SWE - Sweden'], 729 | ['value' => 'SWZ', 'text' => 'SWZ - Swaziland'], 730 | ['value' => 'SXM', 'text' => 'SXM - Sint Maarten (Dutch part)'], 731 | ['value' => 'SYC', 'text' => 'SYC - Seychelles'], 732 | ['value' => 'SYR', 'text' => 'SYR - Syrian Arab Republic'], 733 | ['value' => 'TCA', 'text' => 'TCA - Turks and Caicos Islands'], 734 | ['value' => 'TCD', 'text' => 'TCD - Chad'], 735 | ['value' => 'TGO', 'text' => 'TGO - Togo'], 736 | ['value' => 'THA', 'text' => 'THA - Thailand'], 737 | ['value' => 'TJK', 'text' => 'TJK - Tajikistan'], 738 | ['value' => 'TKL', 'text' => 'TKL - Tokelau'], 739 | ['value' => 'TKM', 'text' => 'TKM - Turkmenistan'], 740 | ['value' => 'TLS', 'text' => 'TLS - Timor-Leste'], 741 | ['value' => 'TON', 'text' => 'TON - Tonga'], 742 | ['value' => 'TTO', 'text' => 'TTO - Trinidad and Tobago'], 743 | ['value' => 'TUN', 'text' => 'TUN - Tunisia'], 744 | ['value' => 'TUR', 'text' => 'TUR - Turkey'], 745 | ['value' => 'TUV', 'text' => 'TUV - Tuvalu'], 746 | ['value' => 'TWN', 'text' => 'TWN - Taiwan, Province of China'], 747 | ['value' => 'TZA', 'text' => 'TZA - Tanzania, United Republic of'], 748 | ['value' => 'UGA', 'text' => 'UGA - Uganda'], 749 | ['value' => 'UKR', 'text' => 'UKR - Ukraine'], 750 | ['value' => 'UMI', 'text' => 'UMI - United States Minor Outlying Islands'], 751 | ['value' => 'URY', 'text' => 'URY - Uruguay'], 752 | ['value' => 'USA', 'text' => 'USA - United States'], 753 | ['value' => 'UZB', 'text' => 'UZB - Uzbekistan'], 754 | ['value' => 'VAT', 'text' => 'VAT - Holy See (Vatican City State)'], 755 | ['value' => 'VCT', 'text' => 'VCT - Saint Vincent and the Grenadines'], 756 | ['value' => 'VEN', 'text' => 'VEN - Venezuela, Bolivarian Republic of'], 757 | ['value' => 'VGB', 'text' => 'VGB - Virgin Islands, British'], 758 | ['value' => 'VIR', 'text' => 'VIR - Virgin Islands, U.S.'], 759 | ['value' => 'VNM', 'text' => 'VNM - Viet Nam'], 760 | ['value' => 'VUT', 'text' => 'VUT - Vanuatu'], 761 | ['value' => 'WLF', 'text' => 'WLF - Wallis and Futuna'], 762 | ['value' => 'WSM', 'text' => 'WSM - Samoa'], 763 | ['value' => 'YEM', 'text' => 'YEM - Yemen'], 764 | ['value' => 'ZAF', 'text' => 'ZAF - South Africa'], 765 | ['value' => 'ZMB', 'text' => 'ZMB - Zambia'], 766 | ['value' => 'ZWE', 'text' => 'ZWE - Zimbabwe'], 767 | ]; 768 | 769 | switch ($this->request->input('param')) { 770 | case 'full': 771 | return $countries; 772 | break; 773 | case 'iso2': 774 | return $countries_iso2; 775 | break; 776 | case 'iso3': 777 | return $countries_iso3; 778 | break; 779 | default: 780 | return $countries; 781 | break; 782 | } 783 | } 784 | } 785 | -------------------------------------------------------------------------------- /Countries/meta.yaml: -------------------------------------------------------------------------------- 1 | name: Countries Suggest Mode 2 | version: 1.0.0 3 | description: Suggest Mode for list of world countries (Full) 4 | url: https://github.com/lesaff/statamicv2-countries 5 | developer: Rudy Affandi 6 | developer_url: https://github.com/lesaff 7 | -------------------------------------------------------------------------------- /Forms/FormsSuggestMode.php: -------------------------------------------------------------------------------- 1 | $form) { 16 | $data[$index]['value'] = $form['name']; 17 | $data[$index]['text'] = $form['title']; 18 | $index++; 19 | } 20 | 21 | return $data; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Forms/meta.yaml: -------------------------------------------------------------------------------- 1 | name: Forms Suggest Mode 2 | version: 1.0.0 3 | description: Suggest Mode for list of available forms 4 | url: https://github.com/lesaff/statamicv2-suggestmodes 5 | developer: Mike Martin 6 | developer_url: https://github.com/mikemartin 7 | -------------------------------------------------------------------------------- /StatesProvinces/StatesProvincesSuggestMode.php: -------------------------------------------------------------------------------- 1 | 'Alberta', 'text' => 'Alberta'], 13 | ['value' => 'British Columbia', 'text' => 'British Columbia'], 14 | ['value' => 'Manitoba', 'text' => 'Manitoba'], 15 | ['value' => 'New Brunswick', 'text' => 'New Brunswick'], 16 | ['value' => 'Newfoundland and Labrador', 'text' => 'Newfoundland and Labrador'], 17 | ['value' => 'Northwest Territories', 'text' => 'Northwest Territories'], 18 | ['value' => 'Nova Scotia', 'text' => 'Nova Scotia'], 19 | ['value' => 'Nunavut', 'text' => 'Nunavut'], 20 | ['value' => 'Ontario', 'text' => 'Ontario'], 21 | ['value' => 'Prince Edward Island', 'text' => 'Prince Edward Island'], 22 | ['value' => 'Quebec', 'text' => 'Quebec'], 23 | ['value' => 'Saskatchewan', 'text' => 'Saskatchewan'], 24 | ['value' => 'Yukon Territory', 'text' => 'Yukon Territory'], 25 | ['value' => 'Alabama', 'text' => 'Alabama'], 26 | ['value' => 'Alaska', 'text' => 'Alaska'], 27 | ['value' => 'Arizona', 'text' => 'Arizona'], 28 | ['value' => 'Arkansas', 'text' => 'Arkansas'], 29 | ['value' => 'California', 'text' => 'California'], 30 | ['value' => 'Colorado', 'text' => 'Colorado'], 31 | ['value' => 'Connecticut', 'text' => 'Connecticut'], 32 | ['value' => 'Delaware', 'text' => 'Delaware'], 33 | ['value' => 'District of Columbia', 'text' => 'District of Columbia'], 34 | ['value' => 'Florida', 'text' => 'Florida'], 35 | ['value' => 'Georgia', 'text' => 'Georgia'], 36 | ['value' => 'Hawaii', 'text' => 'Hawaii'], 37 | ['value' => 'Idaho', 'text' => 'Idaho'], 38 | ['value' => 'Illinois', 'text' => 'Illinois'], 39 | ['value' => 'Indiana', 'text' => 'Indiana'], 40 | ['value' => 'Iowa', 'text' => 'Iowa'], 41 | ['value' => 'Kansas', 'text' => 'Kansas'], 42 | ['value' => 'Kentucky', 'text' => 'Kentucky'], 43 | ['value' => 'Louisiana', 'text' => 'Louisiana'], 44 | ['value' => 'Maine', 'text' => 'Maine'], 45 | ['value' => 'Maryland', 'text' => 'Maryland'], 46 | ['value' => 'Massachusetts', 'text' => 'Massachusetts'], 47 | ['value' => 'Michigan', 'text' => 'Michigan'], 48 | ['value' => 'Minnesota', 'text' => 'Minnesota'], 49 | ['value' => 'Mississippi', 'text' => 'Mississippi'], 50 | ['value' => 'Missouri', 'text' => 'Missouri'], 51 | ['value' => 'Montana', 'text' => 'Montana'], 52 | ['value' => 'Nebraska', 'text' => 'Nebraska'], 53 | ['value' => 'Nevada', 'text' => 'Nevada'], 54 | ['value' => 'New Hampshire', 'text' => 'New Hampshire'], 55 | ['value' => 'New Jersey', 'text' => 'New Jersey'], 56 | ['value' => 'New Mexico', 'text' => 'New Mexico'], 57 | ['value' => 'New York', 'text' => 'New York'], 58 | ['value' => 'North Carolina', 'text' => 'North Carolina'], 59 | ['value' => 'North Dakota', 'text' => 'North Dakota'], 60 | ['value' => 'Ohio', 'text' => 'Ohio'], 61 | ['value' => 'Oklahoma', 'text' => 'Oklahoma'], 62 | ['value' => 'Oregon', 'text' => 'Oregon'], 63 | ['value' => 'Pennsylvania', 'text' => 'Pennsylvania'], 64 | ['value' => 'Rhode Island', 'text' => 'Rhode Island'], 65 | ['value' => 'South Carolina', 'text' => 'South Carolina'], 66 | ['value' => 'South Dakota', 'text' => 'South Dakota'], 67 | ['value' => 'Tennessee', 'text' => 'Tennessee'], 68 | ['value' => 'Texas', 'text' => 'Texas'], 69 | ['value' => 'Utah', 'text' => 'Utah'], 70 | ['value' => 'Vermont', 'text' => 'Vermont'], 71 | ['value' => 'Virginia', 'text' => 'Virginia'], 72 | ['value' => 'Washington', 'text' => 'Washington'], 73 | ['value' => 'West Virginia', 'text' => 'West Virginia'], 74 | ['value' => 'Wisconsin', 'text' => 'Wisconsin'], 75 | ['value' => 'Wyoming', 'text' => 'Wyoming'], 76 | ]; 77 | 78 | $abbr = [ 79 | ['value' => 'AB', 'text' => 'AB - Alberta'], 80 | ['value' => 'BC', 'text' => 'BC - British Columbia'], 81 | ['value' => 'MB', 'text' => 'MB - Manitoba'], 82 | ['value' => 'NB', 'text' => 'NB - New Brunswick'], 83 | ['value' => 'NL', 'text' => 'NL - Newfoundland and Labrador'], 84 | ['value' => 'NS', 'text' => 'NS - Nova Scotia'], 85 | ['value' => 'NT', 'text' => 'NT - Northwest Territories'], 86 | ['value' => 'NU', 'text' => 'NU - Nunavut'], 87 | ['value' => '"ON"', 'text' => 'ON - Ontario'], 88 | ['value' => 'PE', 'text' => 'PE - Prince Edward Island'], 89 | ['value' => 'QC', 'text' => 'QC - Quebec'], 90 | ['value' => 'SK', 'text' => 'SK - Saskatchewan'], 91 | ['value' => 'YT', 'text' => 'YT - Yukon Territory'], 92 | ['value' => 'AL', 'text' => 'AL - Alabama'], 93 | ['value' => 'AK', 'text' => 'AK - Alaska'], 94 | ['value' => 'AZ', 'text' => 'AZ - Arizona'], 95 | ['value' => 'AR', 'text' => 'AR - Arkansas'], 96 | ['value' => 'CA', 'text' => 'CA - California'], 97 | ['value' => 'CO', 'text' => 'CO - Colorado'], 98 | ['value' => 'CT', 'text' => 'CT - Connecticut'], 99 | ['value' => 'DE', 'text' => 'DE - Delaware'], 100 | ['value' => 'DC', 'text' => 'DC - District of Columbia'], 101 | ['value' => 'FL', 'text' => 'FL - Florida'], 102 | ['value' => 'GA', 'text' => 'GA - Georgia'], 103 | ['value' => 'HI', 'text' => 'HI - Hawaii'], 104 | ['value' => 'ID', 'text' => 'ID - Idaho'], 105 | ['value' => 'IL', 'text' => 'IL - Illinois'], 106 | ['value' => 'IN', 'text' => 'IN - Indiana'], 107 | ['value' => 'IA', 'text' => 'IA - Iowa'], 108 | ['value' => 'KS', 'text' => 'KS - Kansas'], 109 | ['value' => 'KY', 'text' => 'KY - Kentucky'], 110 | ['value' => 'LA', 'text' => 'LA - Louisiana'], 111 | ['value' => 'ME', 'text' => 'ME - Maine'], 112 | ['value' => 'MD', 'text' => 'MD - Maryland'], 113 | ['value' => 'MA', 'text' => 'MA - Massachusetts'], 114 | ['value' => 'MI', 'text' => 'MI - Michigan'], 115 | ['value' => 'MN', 'text' => 'MN - Minnesota'], 116 | ['value' => 'MS', 'text' => 'MS - Mississippi'], 117 | ['value' => 'MO', 'text' => 'MO - Missouri'], 118 | ['value' => 'MT', 'text' => 'MT - Montana'], 119 | ['value' => 'NE', 'text' => 'NE - Nebraska'], 120 | ['value' => 'NV', 'text' => 'NV - Nevada'], 121 | ['value' => 'NH', 'text' => 'NH - New Hampshire'], 122 | ['value' => 'NJ', 'text' => 'NJ - New Jersey'], 123 | ['value' => 'NM', 'text' => 'NM - New Mexico'], 124 | ['value' => 'NY', 'text' => 'NY - New York'], 125 | ['value' => 'NC', 'text' => 'NC - North Carolina'], 126 | ['value' => 'ND', 'text' => 'ND - North Dakota'], 127 | ['value' => 'OH', 'text' => 'OH - Ohio'], 128 | ['value' => 'OK', 'text' => 'OK - Oklahoma'], 129 | ['value' => 'OR', 'text' => 'OR - Oregon'], 130 | ['value' => 'PA', 'text' => 'PA - Pennsylvania'], 131 | ['value' => 'RI', 'text' => 'RI - Rhode Island'], 132 | ['value' => 'SC', 'text' => 'SC - South Carolina'], 133 | ['value' => 'SD', 'text' => 'SD - South Dakota'], 134 | ['value' => 'TN', 'text' => 'TN - Tennessee'], 135 | ['value' => 'TX', 'text' => 'TX - Texas'], 136 | ['value' => 'UT', 'text' => 'UT - Utah'], 137 | ['value' => 'VT', 'text' => 'VT - Vermont'], 138 | ['value' => 'VA', 'text' => 'VA - Virginia'], 139 | ['value' => 'WA', 'text' => 'WA - Washington'], 140 | ['value' => 'WV', 'text' => 'WV - West Virginia'], 141 | ['value' => 'WI', 'text' => 'WI - Wisconsin'], 142 | ['value' => 'WY', 'text' => 'WY - Wyoming'], 143 | ]; 144 | 145 | switch ($this->request->input('param')) { 146 | case 'full': 147 | return $full; 148 | break; 149 | case 'abbr': 150 | return $abbr; 151 | break; 152 | default: 153 | return $full; 154 | break; 155 | } 156 | } 157 | } 158 | -------------------------------------------------------------------------------- /StatesProvinces/meta.yaml: -------------------------------------------------------------------------------- 1 | name: States and Provinces Suggest Mode 2 | version: 1.0.1 3 | description: Suggest Mode for US States and Canadian Provinces (Full and abbreviated) 4 | url: https://github.com/lesaff/statamicv2-suggestmodes 5 | developer: Rudy Affandi 6 | developer_url: https://github.com/lesaff 7 | -------------------------------------------------------------------------------- /Typeforms/TypeformsSuggestMode.php: -------------------------------------------------------------------------------- 1 | request->input('api_key'); 12 | $forms = @json_decode(file_get_contents($request), true); 13 | $data = []; 14 | $index = 0; 15 | foreach ($forms as $key => $form) { 16 | $data[$index]['value'] = $form['id']; 17 | $data[$index]['text'] = $form['name']; 18 | $index++; 19 | } 20 | 21 | return $data; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Typeforms/default.yaml: -------------------------------------------------------------------------------- 1 | api_key: your-api-key 2 | -------------------------------------------------------------------------------- /Typeforms/meta.yaml: -------------------------------------------------------------------------------- 1 | name: Typeform Suggest Mode 2 | version: 1.0.0 3 | description: Suggest Mode for list of all your Typeforms 4 | url: https://github.com/lesaff/statamicv2-suggestmodes 5 | developer: Mike Martin 6 | developer_url: https://github.com/mikemartin 7 | -------------------------------------------------------------------------------- /UsersFiltered/UsersFilteredSuggestMode.php: -------------------------------------------------------------------------------- 1 | request->input('role'); 25 | if ($role) { 26 | $users = $users->filter(function ($user) use ($role) { 27 | /** @var \Statamic\Data\Users\User $user */ 28 | return $user->hasRole($role); 29 | }); 30 | } 31 | 32 | $group = $this->request->input('group'); 33 | if ($group) { 34 | $users = $users->filter(function ($user) use ($group) { 35 | /** @var \Statamic\Data\Users\User $user */ 36 | return $user->inGroup($group); 37 | }); 38 | } 39 | 40 | // required to pass the instance to the map method for the label method 41 | $mode = $this; 42 | return $users 43 | ->map(function ($user) use($mode) { 44 | /** @var \Statamic\Data\Users\User $user */ 45 | return ['value' => $user->id(), 'text' => $mode->label($user, 'username')]; 46 | }) 47 | ->values() 48 | ->all(); 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /UsersFiltered/meta.yaml: -------------------------------------------------------------------------------- 1 | name: Filtered User Suggest Mode 2 | version: 1.0.0 3 | description: Suggest Mode for users with filter capability 4 | url: https://github.com/lesaff/statamicv2-suggestmodes 5 | developer: Rémy Böhler 6 | developer_url: https://subpixel.ch/ 7 | -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | # Statamic v2.x Suggest Mode Collection []() 2 | [Contributors](https://github.com/lesaff/statamic2-suggestmodes/graphs/contributors) 3 | 4 | ## What are these? 5 | These are a bunch of useful `SuggestMode` addons for Statamic v2.x. 6 | 7 | ## Installation 8 | Copy the one or more folder(s) to your `site/addons` folder in your Statamic v2.x installation 9 | 10 | ## Index 11 | [1. Countries](#countries) 12 | [2. State and Provinces](#statesprovinces) 13 | [3. Collections](#collections) 14 | [4. Forms](#forms) 15 | [5. Typeforms](#typeforms) 16 | 17 | ## Countries 18 | List of world country names in ISO format (full English spelling) 19 | 20 |  21 | 22 | #### How to use 23 | To return a list of country names in full English spelling 24 | ``` 25 | country: 26 | type: suggest 27 | mode: Countries 28 | param: full 29 | max_items: 1 30 | display: Country (Full English spelling) 31 | ``` 32 | To return a list of country names in 2 character abbreviation (ISO2) 33 | ``` 34 | country: 35 | type: suggest 36 | mode: Countries 37 | param: iso2 38 | max_items: 1 39 | display: Country (ISO2 abbreviation) 40 | ``` 41 | To return a list of country names in 3 character abbreviation (ISO3) 42 | ``` 43 | country: 44 | type: suggest 45 | mode: Countries 46 | param: iso3 47 | max_items: 1 48 | display: Country (ISO3 abbreviation) 49 | ``` 50 | 51 | ## StatesProvinces 52 | List of US and Canada states/provinces names (full English spelling) 53 | 54 |  55 | 56 | #### How to use 57 | To return a list of US and Canada states/provinces names in full English spelling 58 | ``` 59 | state_province: 60 | type: suggest 61 | mode: StatesProvinces 62 | param: full 63 | max_items: 1 64 | display: State/Province (Full English spelling) 65 | ``` 66 | To return a list of US and Canada states/provinces names in 2 character abbreviation 67 | ``` 68 | state_province: 69 | type: suggest 70 | mode: StatesProvinces 71 | param: abbr 72 | max_items: 1 73 | display: State/Province (Full English spelling) 74 | ``` 75 | 76 | ## Collections 77 | List all available collections 78 | 79 |  80 | 81 | #### How to use 82 | To return a list of all your available collections 83 | ``` 84 | rss_feed: 85 | type: suggest 86 | mode: Collections 87 | display: RSS Feed 88 | instructions: Select which collection(s) to use for your RSS Feed 89 | ``` 90 | 91 | ## Forms 92 | List all available forms 93 | 94 |  95 | 96 | #### How to use 97 | To return a list of all your available forms 98 | ``` 99 | form: 100 | type: suggest 101 | mode: forms 102 | max_items: 1 103 | display: Form 104 | ``` 105 | 106 | To output your form automagically 107 | ``` 108 | {{ form:create in="{form}" }} 109 | {{ fields }} 110 |