From 9b33dfed93e2f3899efe6583d491546b0b270906 Mon Sep 17 00:00:00 2001 From: mrprotocoll Date: Wed, 4 Oct 2023 21:02:37 +0100 Subject: [PATCH 1/3] Update CountryDataProvider.stub to include country_code and calling_code for all current countries avaries in the country data returned --- README.md | 2 +- .../DataProviders/CountryDataProvider.stub | 494 +++++++++--------- 2 files changed, 248 insertions(+), 248 deletions(-) diff --git a/README.md b/README.md index 685fdf1..e565be5 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ php artisan country-data:install ### Requirements ``` bash -Laravel 5.8.x, 6.x, 7.x or 8.x +Laravel 5.8.x, 6.x, 7.x, 8.x, 9.x, 10.x PHP >= 7.1.3 or Grater ``` diff --git a/src/resources/stubs/DataProviders/CountryDataProvider.stub b/src/resources/stubs/DataProviders/CountryDataProvider.stub index 465e770..f4214b3 100644 --- a/src/resources/stubs/DataProviders/CountryDataProvider.stub +++ b/src/resources/stubs/DataProviders/CountryDataProvider.stub @@ -7,252 +7,252 @@ abstract class CountryDataProvider public static function data(): array { return [ - ['id' => '1', 'name' => 'afghanistan'], - ['id' => '2', 'name' => 'albania'], - ['id' => '3', 'name' => 'algeria'], - ['id' => '4', 'name' => 'american samoa'], - ['id' => '5', 'name' => 'andorra'], - ['id' => '6', 'name' => 'angola'], - ['id' => '7', 'name' => 'anguilla'], - ['id' => '8', 'name' => 'antarctica'], - ['id' => '9', 'name' => 'antigua and barbuda'], - ['id' => '10', 'name' => 'argentina'], - ['id' => '11', 'name' => 'armenia'], - ['id' => '12', 'name' => 'aruba'], - ['id' => '13', 'name' => 'australia'], - ['id' => '14', 'name' => 'austria'], - ['id' => '15', 'name' => 'azerbaijan'], - ['id' => '16', 'name' => 'bahamas the'], - ['id' => '17', 'name' => 'bahrain'], - ['id' => '18', 'name' => 'bangladesh'], - ['id' => '19', 'name' => 'barbados'], - ['id' => '20', 'name' => 'belarus'], - ['id' => '21', 'name' => 'belgium'], - ['id' => '22', 'name' => 'belize'], - ['id' => '23', 'name' => 'benin'], - ['id' => '24', 'name' => 'bermuda'], - ['id' => '25', 'name' => 'bhutan'], - ['id' => '26', 'name' => 'bolivia'], - ['id' => '27', 'name' => 'bosnia and herzegovina'], - ['id' => '28', 'name' => 'botswana'], - ['id' => '29', 'name' => 'bouvet island'], - ['id' => '30', 'name' => 'brazil'], - ['id' => '31', 'name' => 'british indian ocean territory'], - ['id' => '32', 'name' => 'brunei'], - ['id' => '33', 'name' => 'bulgaria'], - ['id' => '34', 'name' => 'burkina faso'], - ['id' => '35', 'name' => 'burundi'], - ['id' => '36', 'name' => 'cambodia'], - ['id' => '37', 'name' => 'cameroon'], - ['id' => '38', 'name' => 'canada'], - ['id' => '39', 'name' => 'cape verde'], - ['id' => '40', 'name' => 'cayman islands'], - ['id' => '41', 'name' => 'central african republic'], - ['id' => '42', 'name' => 'chad'], - ['id' => '43', 'name' => 'chile'], - ['id' => '44', 'name' => 'china'], - ['id' => '45', 'name' => 'christmas island'], - ['id' => '46', 'name' => 'cocos (keeling) islands'], - ['id' => '47', 'name' => 'colombia'], - ['id' => '48', 'name' => 'comoros'], - ['id' => '49', 'name' => 'congo'], - ['id' => '50', 'name' => 'congo the democratic republic of the'], - ['id' => '51', 'name' => 'cook islands'], - ['id' => '52', 'name' => 'costa rica'], - ['id' => '53', 'name' => 'cote d\'ivoire (ivory coast)'], - ['id' => '54', 'name' => 'croatia (hrvatska)'], - ['id' => '55', 'name' => 'cuba'], - ['id' => '56', 'name' => 'cyprus'], - ['id' => '57', 'name' => 'czech republic'], - ['id' => '58', 'name' => 'denmark'], - ['id' => '59', 'name' => 'djibouti'], - ['id' => '60', 'name' => 'dominica'], - ['id' => '61', 'name' => 'dominican republic'], - ['id' => '62', 'name' => 'east timor'], - ['id' => '63', 'name' => 'ecuador'], - ['id' => '64', 'name' => 'egypt'], - ['id' => '65', 'name' => 'el salvador'], - ['id' => '66', 'name' => 'equatorial guinea'], - ['id' => '67', 'name' => 'eritrea'], - ['id' => '68', 'name' => 'estonia'], - ['id' => '69', 'name' => 'ethiopia'], - ['id' => '70', 'name' => 'external territories of australia'], - ['id' => '71', 'name' => 'falkland islands'], - ['id' => '72', 'name' => 'faroe islands'], - ['id' => '73', 'name' => 'fiji islands'], - ['id' => '74', 'name' => 'finland'], - ['id' => '75', 'name' => 'france'], - ['id' => '76', 'name' => 'french guiana'], - ['id' => '77', 'name' => 'french polynesia'], - ['id' => '78', 'name' => 'french southern territories'], - ['id' => '79', 'name' => 'gabon'], - ['id' => '80', 'name' => 'gambia the'], - ['id' => '81', 'name' => 'georgia'], - ['id' => '82', 'name' => 'germany'], - ['id' => '83', 'name' => 'ghana'], - ['id' => '84', 'name' => 'gibraltar'], - ['id' => '85', 'name' => 'greece'], - ['id' => '86', 'name' => 'greenland'], - ['id' => '87', 'name' => 'grenada'], - ['id' => '88', 'name' => 'guadeloupe'], - ['id' => '89', 'name' => 'guam'], - ['id' => '90', 'name' => 'guatemala'], - ['id' => '91', 'name' => 'guernsey and alderney'], - ['id' => '92', 'name' => 'guinea'], - ['id' => '93', 'name' => 'guinea-bissau'], - ['id' => '94', 'name' => 'guyana'], - ['id' => '95', 'name' => 'haiti'], - ['id' => '96', 'name' => 'heard and mcdonald islands'], - ['id' => '97', 'name' => 'honduras'], - ['id' => '98', 'name' => 'hong kong s.a.r.'], - ['id' => '99', 'name' => 'hungary'], - ['id' => '100', 'name' => 'iceland'], - ['id' => '101', 'name' => 'india'], - ['id' => '102', 'name' => 'indonesia'], - ['id' => '103', 'name' => 'iran'], - ['id' => '104', 'name' => 'iraq'], - ['id' => '105', 'name' => 'ireland'], - ['id' => '106', 'name' => 'israel'], - ['id' => '107', 'name' => 'italy'], - ['id' => '108', 'name' => 'jamaica'], - ['id' => '109', 'name' => 'japan'], - ['id' => '110', 'name' => 'jersey'], - ['id' => '111', 'name' => 'jordan'], - ['id' => '112', 'name' => 'kazakhstan'], - ['id' => '113', 'name' => 'kenya'], - ['id' => '114', 'name' => 'kiribati'], - ['id' => '115', 'name' => 'korea north'], - ['id' => '116', 'name' => 'korea south'], - ['id' => '117', 'name' => 'kuwait'], - ['id' => '118', 'name' => 'kyrgyzstan'], - ['id' => '119', 'name' => 'laos'], - ['id' => '120', 'name' => 'latvia'], - ['id' => '121', 'name' => 'lebanon'], - ['id' => '122', 'name' => 'lesotho'], - ['id' => '123', 'name' => 'liberia'], - ['id' => '124', 'name' => 'libya'], - ['id' => '125', 'name' => 'liechtenstein'], - ['id' => '126', 'name' => 'lithuania'], - ['id' => '127', 'name' => 'luxembourg'], - ['id' => '128', 'name' => 'macau s.a.r.'], - ['id' => '129', 'name' => 'macedonia'], - ['id' => '130', 'name' => 'madagascar'], - ['id' => '131', 'name' => 'malawi'], - ['id' => '132', 'name' => 'malaysia'], - ['id' => '133', 'name' => 'maldives'], - ['id' => '134', 'name' => 'mali'], - ['id' => '135', 'name' => 'malta'], - ['id' => '136', 'name' => 'man (isle of)'], - ['id' => '137', 'name' => 'marshall islands'], - ['id' => '138', 'name' => 'martinique'], - ['id' => '139', 'name' => 'mauritania'], - ['id' => '140', 'name' => 'mauritius'], - ['id' => '141', 'name' => 'mayotte'], - ['id' => '142', 'name' => 'mexico'], - ['id' => '143', 'name' => 'micronesia'], - ['id' => '144', 'name' => 'moldova'], - ['id' => '145', 'name' => 'monaco'], - ['id' => '146', 'name' => 'mongolia'], - ['id' => '147', 'name' => 'montserrat'], - ['id' => '148', 'name' => 'morocco'], - ['id' => '149', 'name' => 'mozambique'], - ['id' => '150', 'name' => 'myanmar'], - ['id' => '151', 'name' => 'namibia'], - ['id' => '152', 'name' => 'nauru'], - ['id' => '153', 'name' => 'nepal'], - ['id' => '154', 'name' => 'netherlands antilles'], - ['id' => '155', 'name' => 'netherlands the'], - ['id' => '156', 'name' => 'new caledonia'], - ['id' => '157', 'name' => 'new zealand'], - ['id' => '158', 'name' => 'nicaragua'], - ['id' => '159', 'name' => 'niger'], - ['id' => '160', 'name' => 'nigeria'], - ['id' => '161', 'name' => 'niue'], - ['id' => '162', 'name' => 'norfolk island'], - ['id' => '163', 'name' => 'northern mariana islands'], - ['id' => '164', 'name' => 'norway'], - ['id' => '165', 'name' => 'oman'], - ['id' => '166', 'name' => 'pakistan'], - ['id' => '167', 'name' => 'palau'], - ['id' => '168', 'name' => 'palestinian territory occupied'], - ['id' => '169', 'name' => 'panama'], - ['id' => '170', 'name' => 'papua new guinea'], - ['id' => '171', 'name' => 'paraguay'], - ['id' => '172', 'name' => 'peru'], - ['id' => '173', 'name' => 'philippines'], - ['id' => '174', 'name' => 'pitcairn island'], - ['id' => '175', 'name' => 'poland'], - ['id' => '176', 'name' => 'portugal'], - ['id' => '177', 'name' => 'puerto rico'], - ['id' => '178', 'name' => 'qatar'], - ['id' => '179', 'name' => 'reunion'], - ['id' => '180', 'name' => 'romania'], - ['id' => '181', 'name' => 'russia'], - ['id' => '182', 'name' => 'rwanda'], - ['id' => '183', 'name' => 'saint helena'], - ['id' => '184', 'name' => 'saint kitts and nevis'], - ['id' => '185', 'name' => 'saint lucia'], - ['id' => '186', 'name' => 'saint pierre and miquelon'], - ['id' => '187', 'name' => 'saint vincent and the grenadines'], - ['id' => '188', 'name' => 'samoa'], - ['id' => '189', 'name' => 'san marino'], - ['id' => '190', 'name' => 'sao tome and principe'], - ['id' => '191', 'name' => 'saudi arabia'], - ['id' => '192', 'name' => 'senegal'], - ['id' => '193', 'name' => 'serbia'], - ['id' => '194', 'name' => 'seychelles'], - ['id' => '195', 'name' => 'sierra leone'], - ['id' => '196', 'name' => 'singapore'], - ['id' => '197', 'name' => 'slovakia'], - ['id' => '198', 'name' => 'slovenia'], - ['id' => '199', 'name' => 'smaller territories of the uk'], - ['id' => '200', 'name' => 'solomon islands'], - ['id' => '201', 'name' => 'somalia'], - ['id' => '202', 'name' => 'south africa'], - ['id' => '203', 'name' => 'south georgia'], - ['id' => '204', 'name' => 'south sudan'], - ['id' => '205', 'name' => 'spain'], - ['id' => '206', 'name' => 'sri lanka'], - ['id' => '207', 'name' => 'sudan'], - ['id' => '208', 'name' => 'suriname'], - ['id' => '209', 'name' => 'svalbard and jan mayen islands'], - ['id' => '210', 'name' => 'swaziland'], - ['id' => '211', 'name' => 'sweden'], - ['id' => '212', 'name' => 'switzerland'], - ['id' => '213', 'name' => 'syria'], - ['id' => '214', 'name' => 'taiwan'], - ['id' => '215', 'name' => 'tajikistan'], - ['id' => '216', 'name' => 'tanzania'], - ['id' => '217', 'name' => 'thailand'], - ['id' => '218', 'name' => 'togo'], - ['id' => '219', 'name' => 'tokelau'], - ['id' => '220', 'name' => 'tonga'], - ['id' => '221', 'name' => 'trinidad and tobago'], - ['id' => '222', 'name' => 'tunisia'], - ['id' => '223', 'name' => 'turkey'], - ['id' => '224', 'name' => 'turkmenistan'], - ['id' => '225', 'name' => 'turks and caicos islands'], - ['id' => '226', 'name' => 'tuvalu'], - ['id' => '227', 'name' => 'uganda'], - ['id' => '228', 'name' => 'ukraine'], - ['id' => '229', 'name' => 'united arab emirates'], - ['id' => '230', 'name' => 'united kingdom'], - ['id' => '231', 'name' => 'united states'], - ['id' => '232', 'name' => 'united states minor outlying islands'], - ['id' => '233', 'name' => 'uruguay'], - ['id' => '234', 'name' => 'uzbekistan'], - ['id' => '235', 'name' => 'vanuatu'], - ['id' => '236', 'name' => 'vatican city state (holy see)'], - ['id' => '237', 'name' => 'venezuela'], - ['id' => '238', 'name' => 'vietnam'], - ['id' => '239', 'name' => 'virgin islands (british)'], - ['id' => '240', 'name' => 'virgin islands (us)'], - ['id' => '241', 'name' => 'wallis and futuna islands'], - ['id' => '242', 'name' => 'western sahara'], - ['id' => '243', 'name' => 'yemen'], - ['id' => '244', 'name' => 'yugoslavia'], - ['id' => '245', 'name' => 'zambia'], - ['id' => '246', 'name' => 'zimbabwe'] - ]; + ['id' => '1', 'name' => 'afghanistan', 'currency_code' => 'AFN', 'calling_code' => '93'], + ['id' => '2', 'name' => 'albania', 'currency_code' => 'ALL', 'calling_code' => '355'], + ['id' => '3', 'name' => 'algeria', 'currency_code' => 'DZD', 'calling_code' => '213'], + ['id' => '4', 'name' => 'american samoa', 'currency_code' => 'USD', 'calling_code' => '1-684'], + ['id' => '5', 'name' => 'andorra', 'currency_code' => 'EUR', 'calling_code' => '376'], + ['id' => '6', 'name' => 'angola', 'currency_code' => 'AOA', 'calling_code' => '244'], + ['id' => '7', 'name' => 'anguilla', 'currency_code' => 'XCD', 'calling_code' => '1-264'], + ['id' => '8', 'name' => 'antarctica', 'currency_code' => '', 'calling_code' => '672'], + ['id' => '9', 'name' => 'antigua and barbuda', 'currency_code' => 'XCD', 'calling_code' => '1-268'], + ['id' => '10', 'name' => 'argentina', 'currency_code' => 'ARS', 'calling_code' => '54'], + ['id' => '11', 'name' => 'armenia', 'currency_code' => 'AMD', 'calling_code' => '374'], + ['id' => '12', 'name' => 'aruba', 'currency_code' => 'AWG', 'calling_code' => '297'], + ['id' => '13', 'name' => 'australia', 'currency_code' => 'AUD', 'calling_code' => '61'], + ['id' => '14', 'name' => 'austria', 'currency_code' => 'EUR', 'calling_code' => '43'], + ['id' => '15', 'name' => 'azerbaijan', 'currency_code' => 'AZN', 'calling_code' => '994'], + ['id' => '16', 'name' => 'bahamas the', 'currency_code' => 'BSD', 'calling_code' => '1-242'], + ['id' => '17', 'name' => 'bahrain', 'currency_code' => 'BHD', 'calling_code' => '973'], + ['id' => '18', 'name' => 'bangladesh', 'currency_code' => 'BDT', 'calling_code' => '880'], + ['id' => '19', 'name' => 'barbados', 'currency_code' => 'BBD', 'calling_code' => '1-246'], + ['id' => '20', 'name' => 'belarus', 'currency_code' => 'BYN', 'calling_code' => '375'], + ['id' => '21', 'name' => 'belgium', 'currency_code' => 'EUR', 'calling_code' => '32'], + ['id' => '22', 'name' => 'belize', 'currency_code' => 'BZD', 'calling_code' => '501'], + ['id' => '23', 'name' => 'benin', 'currency_code' => 'XOF', 'calling_code' => '229'], + ['id' => '24', 'name' => 'bermuda', 'currency_code' => 'BMD', 'calling_code' => '1-441'], + ['id' => '25', 'name' => 'bhutan', 'currency_code' => 'BTN', 'calling_code' => '975'], + ['id' => '26', 'name' => 'bolivia', 'currency_code' => 'BOB', 'calling_code' => '591'], + ['id' => '27', 'name' => 'bosnia and herzegovina', 'currency_code' => 'BAM', 'calling_code' => '387'], + ['id' => '28', 'name' => 'botswana', 'currency_code' => 'BWP', 'calling_code' => '267'], + ['id' => '29', 'name' => 'bouvet island', 'currency_code' => '', 'calling_code' => '47'], + ['id' => '30', 'name' => 'brazil', 'currency_code' => 'BRL', 'calling_code' => '55'], + ['id' => '31', 'name' => 'british indian ocean territory', 'currency_code' => 'USD', 'calling_code' => '246'], + ['id' => '32', 'name' => 'brunei', 'currency_code' => 'BND', 'calling_code' => '673'], + ['id' => '33', 'name' => 'bulgaria', 'currency_code' => 'BGN', 'calling_code' => '359'], + ['id' => '34', 'name' => 'burkina faso', 'currency_code' => 'XOF', 'calling_code' => '226'], + ['id' => '35', 'name' => 'burundi', 'currency_code' => 'BIF', 'calling_code' => '257'], + ['id' => '36', 'name' => 'cambodia', 'currency_code' => 'KHR', 'calling_code' => '855'], + ['id' => '37', 'name' => 'cameroon', 'currency_code' => 'XAF', 'calling_code' => '237'], + ['id' => '38', 'name' => 'canada', 'currency_code' => 'CAD', 'calling_code' => '1'], + ['id' => '39', 'name' => 'cape verde', 'currency_code' => 'CVE', 'calling_code' => '238'], + ['id' => '40', 'name' => 'cayman islands', 'currency_code' => 'KYD', 'calling_code' => '1-345'], + ['id' => '41', 'name' => 'central african republic', 'currency_code' => 'XAF', 'calling_code' => '236'], + ['id' => '42', 'name' => 'chad', 'currency_code' => 'XAF', 'calling_code' => '235'], + ['id' => '43', 'name' => 'chile', 'currency_code' => 'CLP', 'calling_code' => '56'], + ['id' => '44', 'name' => 'china', 'currency_code' => 'CNY', 'calling_code' => '86'], + ['id' => '45', 'name' => 'christmas island', 'currency_code' => 'AUD', 'calling_code' => '61'], + ['id' => '46', 'name' => 'cocos (keeling) islands', 'currency_code' => 'AUD', 'calling_code' => '61'], + ['id' => '47', 'name' => 'colombia', 'currency_code' => 'COP', 'calling_code' => '57'], + ['id' => '48', 'name' => 'comoros', 'currency_code' => 'KMF', 'calling_code' => '269'], + ['id' => '49', 'name' => 'congo', 'currency_code' => 'CDF', 'calling_code' => '243'], + ['id' => '50', 'name' => 'congo the democratic republic of the', 'currency_code' => 'CDF', 'calling_code' => '243'], + ['id' => '51', 'name' => 'cook islands', 'currency_code' => 'NZD', 'calling_code' => '682'], + ['id' => '52', 'name' => 'costa rica', 'currency_code' => 'CRC', 'calling_code' => '506'], + ['id' => '53', 'name' => 'cote d\'ivoire (ivory coast)', 'currency_code' => 'XOF', 'calling_code' => '225'], + ['id' => '54', 'name' => 'croatia (hrvatska)', 'currency_code' => 'HRK', 'calling_code' => '385'], + ['id' => '55', 'name' => 'cuba', 'currency_code' => 'CUP', 'calling_code' => '53'], + ['id' => '56', 'name' => 'cyprus', 'currency_code' => 'EUR', 'calling_code' => '357'], + ['id' => '57', 'name' => 'czech republic', 'currency_code' => 'CZK', 'calling_code' => '420'], + ['id' => '58', 'name' => 'denmark', 'currency_code' => 'DKK', 'calling_code' => '45'], + ['id' => '59', 'name' => 'djibouti', 'currency_code' => 'DJF', 'calling_code' => '253'], + ['id' => '60', 'name' => 'dominica', 'currency_code' => 'XCD', 'calling_code' => '1-767'], + ['id' => '61', 'name' => 'dominican republic', 'currency_code' => 'DOP', 'calling_code' => '1-809, 1-829, 1-849'], + ['id' => '62', 'name' => 'east timor', 'currency_code' => 'USD', 'calling_code' => '670'], + ['id' => '63', 'name' => 'ecuador', 'currency_code' => 'USD', 'calling_code' => '593'], + ['id' => '64', 'name' => 'egypt', 'currency_code' => 'EGP', 'calling_code' => '20'], + ['id' => '65', 'name' => 'el salvador', 'currency_code' => 'USD', 'calling_code' => '503'], + ['id' => '66', 'name' => 'equatorial guinea', 'currency_code' => 'XAF', 'calling_code' => '240'], + ['id' => '67', 'name' => 'eritrea', 'currency_code' => 'ERN', 'calling_code' => '291'], + ['id' => '68', 'name' => 'estonia', 'currency_code' => 'EUR', 'calling_code' => '372'], + ['id' => '69', 'name' => 'ethiopia', 'currency_code' => 'ETB', 'calling_code' => '251'], + ['id' => '70', 'name' => 'external territories of australia', 'currency_code' => 'AUD', 'calling_code' => '61'], + ['id' => '71', 'name' => 'falkland islands', 'currency_code' => 'FKP', 'calling_code' => '500'], + ['id' => '72', 'name' => 'faroe islands', 'currency_code' => 'DKK', 'calling_code' => '298'], + ['id' => '73', 'name' => 'fiji islands', 'currency_code' => 'FJD', 'calling_code' => '679'], + ['id' => '74', 'name' => 'finland', 'currency_code' => 'EUR', 'calling_code' => '358'], + ['id' => '75', 'name' => 'france', 'currency_code' => 'EUR', 'calling_code' => '33'], + ['id' => '76', 'name' => 'french guiana', 'currency_code' => 'EUR', 'calling_code' => '594'], + ['id' => '77', 'name' => 'french polynesia', 'currency_code' => 'XPF', 'calling_code' => '689'], + ['id' => '78', 'name' => 'french southern territories', 'currency_code' => 'EUR', 'calling_code' => '262'], + ['id' => '79', 'name' => 'gabon', 'currency_code' => 'XAF', 'calling_code' => '241'], + ['id' => '80', 'name' => 'gambia the', 'currency_code' => 'GMD', 'calling_code' => '220'], + ['id' => '81', 'name' => 'georgia', 'currency_code' => 'GEL', 'calling_code' => '995'], + ['id' => '82', 'name' => 'germany', 'currency_code' => 'EUR', 'calling_code' => '49'], + ['id' => '83', 'name' => 'ghana', 'currency_code' => 'GHS', 'calling_code' => '233'], + ['id' => '84', 'name' => 'gibraltar', 'currency_code' => 'GIP', 'calling_code' => '350'], + ['id' => '85', 'name' => 'greece', 'currency_code' => 'EUR', 'calling_code' => '30'], + ['id' => '86', 'name' => 'greenland', 'currency_code' => 'DKK', 'calling_code' => '299'], + ['id' => '87', 'name' => 'grenada', 'currency_code' => 'XCD', 'calling_code' => '1-473'], + ['id' => '88', 'name' => 'guadeloupe', 'currency_code' => 'EUR', 'calling_code' => '590'], + ['id' => '89', 'name' => 'guam', 'currency_code' => 'USD', 'calling_code' => '1-671'], + ['id' => '90', 'name' => 'guatemala', 'currency_code' => 'GTQ', 'calling_code' => '502'], + ['id' => '91', 'name' => 'guernsey and alderney', 'currency_code' => 'GGP', 'calling_code' => '44'], + ['id' => '92', 'name' => 'guinea', 'currency_code' => 'GNF', 'calling_code' => '224'], + ['id' => '93', 'name' => 'guinea-bissau', 'currency_code' => 'XOF', 'calling_code' => '245'], + ['id' => '94', 'name' => 'guyana', 'currency_code' => 'GYD', 'calling_code' => '592'], + ['id' => '95', 'name' => 'haiti', 'currency_code' => 'HTG', 'calling_code' => '509'], + ['id' => '96', 'name' => 'heard and mcdonald islands', 'currency_code' => '', 'calling_code' => '0'], + ['id' => '97', 'name' => 'honduras', 'currency_code' => 'HNL', 'calling_code' => '504'], + ['id' => '98', 'name' => 'hong kong s.a.r.', 'currency_code' => 'HKD', 'calling_code' => '852'], + ['id' => '99', 'name' => 'hungary', 'currency_code' => 'HUF', 'calling_code' => '36'], + ['id' => '100', 'name' => 'iceland', 'currency_code' => 'ISK', 'calling_code' => '354'], + ['id' => '101', 'name' => 'india', 'currency_code' => 'INR', 'calling_code' => '91'], + ['id' => '102', 'name' => 'indonesia', 'currency_code' => 'IDR', 'calling_code' => '62'], + ['id' => '103', 'name' => 'iran', 'currency_code' => 'IRR', 'calling_code' => '98'], + ['id' => '104', 'name' => 'iraq', 'currency_code' => 'IQD', 'calling_code' => '964'], + ['id' => '105', 'name' => 'ireland', 'currency_code' => 'EUR', 'calling_code' => '353'], + ['id' => '106', 'name' => 'israel', 'currency_code' => 'ILS', 'calling_code' => '972'], + ['id' => '107', 'name' => 'italy', 'currency_code' => 'EUR', 'calling_code' => '39'], + ['id' => '108', 'name' => 'jamaica', 'currency_code' => 'JMD', 'calling_code' => '1-876'], + ['id' => '109', 'name' => 'japan', 'currency_code' => 'JPY', 'calling_code' => '81'], + ['id' => '110', 'name' => 'jersey', 'currency_code' => 'JEP', 'calling_code' => '44'], + ['id' => '111', 'name' => 'jordan', 'currency_code' => 'JOD', 'calling_code' => '962'], + ['id' => '112', 'name' => 'kazakhstan', 'currency_code' => 'KZT', 'calling_code' => '7'], + ['id' => '113', 'name' => 'kenya', 'currency_code' => 'KES', 'calling_code' => '254'], + ['id' => '114', 'name' => 'kiribati', 'currency_code' => 'AUD', 'calling_code' => '686'], + ['id' => '115', 'name' => 'korea north', 'currency_code' => 'KPW', 'calling_code' => '850'], + ['id' => '116', 'name' => 'korea south', 'currency_code' => 'KRW', 'calling_code' => '82'], + ['id' => '117', 'name' => 'kuwait', 'currency_code' => 'KWD', 'calling_code' => '965'], + ['id' => '118', 'name' => 'kyrgyzstan', 'currency_code' => 'KGS', 'calling_code' => '996'], + ['id' => '119', 'name' => 'laos', 'currency_code' => 'LAK', 'calling_code' => '856'], + ['id' => '120', 'name' => 'latvia', 'currency_code' => 'EUR', 'calling_code' => '371'], + ['id' => '121', 'name' => 'lebanon', 'currency_code' => 'LBP', 'calling_code' => '961'], + ['id' => '122', 'name' => 'lesotho', 'currency_code' => 'LSL', 'calling_code' => '266'], + ['id' => '123', 'name' => 'liberia', 'currency_code' => 'LRD', 'calling_code' => '231'], + ['id' => '124', 'name' => 'libya', 'currency_code' => 'LYD', 'calling_code' => '218'], + ['id' => '125', 'name' => 'liechtenstein', 'currency_code' => 'CHF', 'calling_code' => '423'], + ['id' => '126', 'name' => 'lithuania', 'currency_code' => 'EUR', 'calling_code' => '370'], + ['id' => '127', 'name' => 'luxembourg', 'currency_code' => 'EUR', 'calling_code' => '352'], + ['id' => '128', 'name' => 'macau s.a.r.', 'currency_code' => 'MOP', 'calling_code' => '853'], + ['id' => '129', 'name' => 'macedonia', 'currency_code' => 'MKD', 'calling_code' => '389'], + ['id' => '130', 'name' => 'madagascar', 'currency_code' => 'MGA', 'calling_code' => '261'], + ['id' => '131', 'name' => 'malawi', 'currency_code' => 'MWK', 'calling_code' => '265'], + ['id' => '132', 'name' => 'malaysia', 'currency_code' => 'MYR', 'calling_code' => '60'], + ['id' => '133', 'name' => 'maldives', 'currency_code' => 'MVR', 'calling_code' => '960'], + ['id' => '134', 'name' => 'mali', 'currency_code' => 'XOF', 'calling_code' => '223'], + ['id' => '135', 'name' => 'malta', 'currency_code' => 'EUR', 'calling_code' => '356'], + ['id' => '136', 'name' => 'man (isle of)', 'currency_code' => 'GBP', 'calling_code' => '44'], + ['id' => '137', 'name' => 'marshall islands', 'currency_code' => 'USD', 'calling_code' => '692'], + ['id' => '138', 'name' => 'martinique', 'currency_code' => 'EUR', 'calling_code' => '596'], + ['id' => '139', 'name' => 'mauritania', 'currency_code' => 'MRO', 'calling_code' => '222'], + ['id' => '140', 'name' => 'mauritius', 'currency_code' => 'MUR', 'calling_code' => '230'], + ['id' => '141', 'name' => 'mayotte', 'currency_code' => 'EUR', 'calling_code' => '262'], + ['id' => '142', 'name' => 'mexico', 'currency_code' => 'MXN', 'calling_code' => '52'], + ['id' => '143', 'name' => 'micronesia', 'currency_code' => 'USD', 'calling_code' => '691'], + ['id' => '144', 'name' => 'moldova', 'currency_code' => 'MDL', 'calling_code' => '373'], + ['id' => '145', 'name' => 'monaco', 'currency_code' => 'EUR', 'calling_code' => '377'], + ['id' => '146', 'name' => 'mongolia', 'currency_code' => 'MNT', 'calling_code' => '976'], + ['id' => '147', 'name' => 'montserrat', 'currency_code' => 'XCD', 'calling_code' => '1-664'], + ['id' => '148', 'name' => 'morocco', 'currency_code' => 'MAD', 'calling_code' => '212'], + ['id' => '149', 'name' => 'mozambique', 'currency_code' => 'MZN', 'calling_code' => '258'], + ['id' => '150', 'name' => 'myanmar', 'currency_code' => 'MMK', 'calling_code' => '95'], + ['id' => '151', 'name' => 'namibia', 'currency_code' => 'NAD', 'calling_code' => '264'], + ['id' => '152', 'name' => 'nauru', 'currency_code' => 'AUD', 'calling_code' => '674'], + ['id' => '153', 'name' => 'nepal', 'currency_code' => 'NPR', 'calling_code' => '977'], + ['id' => '154', 'name' => 'netherlands antilles', 'currency_code' => 'ANG', 'calling_code' => '599'], + ['id' => '155', 'name' => 'netherlands the', 'currency_code' => 'EUR', 'calling_code' => '31'], + ['id' => '156', 'name' => 'new caledonia', 'currency_code' => 'XPF', 'calling_code' => '687'], + ['id' => '157', 'name' => 'new zealand', 'currency_code' => 'NZD', 'calling_code' => '64'], + ['id' => '158', 'name' => 'nicaragua', 'currency_code' => 'NIO', 'calling_code' => '505'], + ['id' => '159', 'name' => 'niger', 'currency_code' => 'XOF', 'calling_code' => '227'], + ['id' => '160', 'name' => 'nigeria', 'currency_code' => 'NGN', 'calling_code' => '234'], + ['id' => '161', 'name' => 'niue', 'currency_code' => 'NZD', 'calling_code' => '683'], + ['id' => '162', 'name' => 'norfolk island', 'currency_code' => 'AUD', 'calling_code' => '672'], + ['id' => '163', 'name' => 'northern mariana islands', 'currency_code' => 'USD', 'calling_code' => '1-670'], + ['id' => '164', 'name' => 'norway', 'currency_code' => 'NOK', 'calling_code' => '47'], + ['id' => '165', 'name' => 'oman', 'currency_code' => 'OMR', 'calling_code' => '968'], + ['id' => '166', 'name' => 'pakistan', 'currency_code' => 'PKR', 'calling_code' => '92'], + ['id' => '167', 'name' => 'palau', 'currency_code' => 'USD', 'calling_code' => '680'], + ['id' => '168', 'name' => 'palestinian territory occupied', 'currency_code' => 'ILS', 'calling_code' => '970'], + ['id' => '169', 'name' => 'panama', 'currency_code' => 'PAB', 'calling_code' => '507'], + ['id' => '170', 'name' => 'papua new guinea', 'currency_code' => 'PGK', 'calling_code' => '675'], + ['id' => '171', 'name' => 'paraguay', 'currency_code' => 'PYG', 'calling_code' => '595'], + ['id' => '172', 'name' => 'peru', 'currency_code' => 'PEN', 'calling_code' => '51'], + ['id' => '173', 'name' => 'philippines', 'currency_code' => 'PHP', 'calling_code' => '63'], + ['id' => '174', 'name' => 'pitcairn island', 'currency_code' => 'NZD', 'calling_code' => '870'], + ['id' => '175', 'name' => 'poland', 'currency_code' => 'PLN', 'calling_code' => '48'], + ['id' => '176', 'name' => 'portugal', 'currency_code' => 'EUR', 'calling_code' => '351'], + ['id' => '177', 'name' => 'puerto rico', 'currency_code' => 'USD', 'calling_code' => '1-787, 1-939'], + ['id' => '178', 'name' => 'qatar', 'currency_code' => 'QAR', 'calling_code' => '974'], + ['id' => '179', 'name' => 'reunion', 'currency_code' => 'EUR', 'calling_code' => '262'], + ['id' => '180', 'name' => 'romania', 'currency_code' => 'RON', 'calling_code' => '40'], + ['id' => '181', 'name' => 'russia', 'currency_code' => 'RUB', 'calling_code' => '7'], + ['id' => '182', 'name' => 'rwanda', 'currency_code' => 'RWF', 'calling_code' => '250'], + ['id' => '183', 'name' => 'saint helena', 'currency_code' => 'SHP', 'calling_code' => '290'], + ['id' => '184', 'name' => 'saint kitts and nevis', 'currency_code' => 'XCD', 'calling_code' => '1-869'], + ['id' => '185', 'name' => 'saint lucia', 'currency_code' => 'XCD', 'calling_code' => '1-758'], + ['id' => '186', 'name' => 'saint pierre and miquelon', 'currency_code' => 'EUR', 'calling_code' => '508'], + ['id' => '187', 'name' => 'saint vincent and the grenadines', 'currency_code' => 'XCD', 'calling_code' => '1-784'], + ['id' => '188', 'name' => 'samoa', 'currency_code' => 'WST', 'calling_code' => '685'], + ['id' => '189', 'name' => 'san marino', 'currency_code' => 'EUR', 'calling_code' => '378'], + ['id' => '190', 'name' => 'sao tome and principe', 'currency_code' => 'STD', 'calling_code' => '239'], + ['id' => '191', 'name' => 'saudi arabia', 'currency_code' => 'SAR', 'calling_code' => '966'], + ['id' => '192', 'name' => 'senegal', 'currency_code' => 'XOF', 'calling_code' => '221'], + ['id' => '193', 'name' => 'serbia', 'currency_code' => 'RSD', 'calling_code' => '381'], + ['id' => '194', 'name' => 'seychelles', 'currency_code' => 'SCR', 'calling_code' => '248'], + ['id' => '195', 'name' => 'sierra leone', 'currency_code' => 'SLL', 'calling_code' => '232'], + ['id' => '196', 'name' => 'singapore', 'currency_code' => 'SGD', 'calling_code' => '65'], + ['id' => '197', 'name' => 'slovakia', 'currency_code' => 'EUR', 'calling_code' => '421'], + ['id' => '198', 'name' => 'slovenia', 'currency_code' => 'EUR', 'calling_code' => '386'], + ['id' => '199', 'name' => 'smaller territories of the uk', 'currency_code' => 'GBP', 'calling_code' => '+44'], + ['id' => '200', 'name' => 'solomon islands', 'currency_code' => 'SBD', 'calling_code' => '677'], + ['id' => '201', 'name' => 'somalia', 'currency_code' => 'SOS', 'calling_code' => '252'], + ['id' => '202', 'name' => 'south africa', 'currency_code' => 'ZAR', 'calling_code' => '27'], + ['id' => '203', 'name' => 'south georgia', 'currency_code' => 'GBP', 'calling_code' => '+500'], + ['id' => '204', 'name' => 'south sudan', 'currency_code' => 'SSP', 'calling_code' => '+211'], + ['id' => '205', 'name' => 'spain', 'currency_code' => 'EUR', 'calling_code' => '34'], + ['id' => '206', 'name' => 'sri lanka', 'currency_code' => 'LKR', 'calling_code' => '94'], + ['id' => '207', 'name' => 'sudan', 'currency_code' => 'SDG', 'calling_code' => '249'], + ['id' => '208', 'name' => 'suriname', 'currency_code' => 'SRD', 'calling_code' => '597'], + ['id' => '209', 'name' => 'svalbard and jan mayen islands', 'currency_code' => 'NOK', 'calling_code' => '47'], + ['id' => '210', 'name' => 'swaziland', 'currency_code' => 'SZL', 'calling_code' => '268'], + ['id' => '211', 'name' => 'sweden', 'currency_code' => 'SEK', 'calling_code' => '46'], + ['id' => '212', 'name' => 'switzerland', 'currency_code' => 'CHF', 'calling_code' => '41'], + ['id' => '213', 'name' => 'syria', 'currency_code' => 'SYP', 'calling_code' => '963'], + ['id' => '214', 'name' => 'taiwan', 'currency_code' => 'TWD', 'calling_code' => '886'], + ['id' => '215', 'name' => 'tajikistan', 'currency_code' => 'TJS', 'calling_code' => '992'], + ['id' => '216', 'name' => 'tanzania', 'currency_code' => 'TZS', 'calling_code' => '255'], + ['id' => '217', 'name' => 'thailand', 'currency_code' => 'THB', 'calling_code' => '66'], + ['id' => '218', 'name' => 'togo', 'currency_code' => 'XOF', 'calling_code' => '228'], + ['id' => '219', 'name' => 'tokelau', 'currency_code' => 'NZD', 'calling_code' => '690'], + ['id' => '220', 'name' => 'tonga', 'currency_code' => 'TOP', 'calling_code' => '676'], + ['id' => '221', 'name' => 'trinidad and tobago', 'currency_code' => 'TTD', 'calling_code' => '1-868'], + ['id' => '222', 'name' => 'tunisia', 'currency_code' => 'TND', 'calling_code' => '216'], + ['id' => '223', 'name' => 'turkey', 'currency_code' => 'TRY', 'calling_code' => '90'], + ['id' => '224', 'name' => 'turkmenistan', 'currency_code' => 'TMT', 'calling_code' => '993'], + ['id' => '225', 'name' => 'turks and caicos islands', 'currency_code' => 'USD', 'calling_code' => '1-649'], + ['id' => '226', 'name' => 'tuvalu', 'currency_code' => 'AUD', 'calling_code' => '688'], + ['id' => '227', 'name' => 'uganda', 'currency_code' => 'UGX', 'calling_code' => '256'], + ['id' => '228', 'name' => 'ukraine', 'currency_code' => 'UAH', 'calling_code' => '380'], + ['id' => '229', 'name' => 'united arab emirates', 'currency_code' => 'AED', 'calling_code' => '971'], + ['id' => '230', 'name' => 'united kingdom', 'currency_code' => 'GBP', 'calling_code' => '44'], + ['id' => '231', 'name' => 'united states', 'currency_code' => 'USD', 'calling_code' => '1'], + ['id' => '232', 'name' => 'united states minor outlying islands', 'currency_code' => 'USD', 'calling_code' => '1'], + ['id' => '233', 'name' => 'uruguay', 'currency_code' => 'UYU', 'calling_code' => '598'], + ['id' => '234', 'name' => 'uzbekistan', 'currency_code' => 'UZS', 'calling_code' => '998'], + ['id' => '235', 'name' => 'vanuatu', 'currency_code' => 'VUV', 'calling_code' => '678'], + ['id' => '236', 'name' => 'vatican city state (holy see)', 'currency_code' => 'EUR', 'calling_code' => '379'], + ['id' => '237', 'name' => 'venezuela', 'currency_code' => 'VES', 'calling_code' => '58'], + ['id' => '238', 'name' => 'vietnam', 'currency_code' => 'VND', 'calling_code' => '84'], + ['id' => '239', 'name' => 'virgin islands (british)', 'currency_code' => 'USD', 'calling_code' => '1-284'], + ['id' => '240', 'name' => 'virgin islands (us)', 'currency_code' => 'USD', 'calling_code' => '1-340'], + ['id' => '241', 'name' => 'wallis and futuna islands', 'currency_code' => 'XPF', 'calling_code' => '681'], + ['id' => '242', 'name' => 'western sahara', 'currency_code' => 'MAD', 'calling_code' => '212'], + ['id' => '243', 'name' => 'yemen', 'currency_code' => 'YER', 'calling_code' => '967'], + ['id' => '244', 'name' => 'yugoslavia', 'currency_code' => '', 'calling_code' => ''], + ['id' => '245', 'name' => 'zambia', 'currency_code' => 'ZMW', 'calling_code' => '260'], + ['id' => '246', 'name' => 'zimbabwe', 'currency_code' => 'ZWL', 'calling_code' => '263'], + ]; } } From 5d6acb0c97d6ef539512bcc32c6fba23220b73f8 Mon Sep 17 00:00:00 2001 From: mrprotocoll Date: Wed, 4 Oct 2023 21:31:20 +0100 Subject: [PATCH 2/3] Update migration and Country model to include country_code and calling_code --- CHANGELOG.md | 4 ++++ src/resources/stubs/Models/Country.stub | 2 +- .../2014_02_04_000000_create_country_state_city_table.stub | 2 ++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 50f3e48..bb19ccf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,3 +5,7 @@ All notable changes to `laravel-country-state-city-data` will be documented in t ## 2.0.0 - 2021-05-12 - "Integrity constraint violation: 1062 Duplicate entry" Issue fixed + +## 2.x - 2023-10-04 + +- "Feature: Enhance Countries Table with Currency Code and Calling Code" diff --git a/src/resources/stubs/Models/Country.stub b/src/resources/stubs/Models/Country.stub index c46beff..be7ef5e 100644 --- a/src/resources/stubs/Models/Country.stub +++ b/src/resources/stubs/Models/Country.stub @@ -12,7 +12,7 @@ class Country extends Model use SoftDeletes; protected $fillable = [ - 'id', 'name', 'status' + 'id', 'name', 'country_code', 'calling_code', 'status' ]; public function states(): HasMany diff --git a/src/resources/stubs/migrations/2014_02_04_000000_create_country_state_city_table.stub b/src/resources/stubs/migrations/2014_02_04_000000_create_country_state_city_table.stub index 69f1f05..fab8a52 100644 --- a/src/resources/stubs/migrations/2014_02_04_000000_create_country_state_city_table.stub +++ b/src/resources/stubs/migrations/2014_02_04_000000_create_country_state_city_table.stub @@ -17,6 +17,8 @@ class CreateCountryStateCityTable extends Migration Schema::create('countries', function (Blueprint $table) { $table->bigIncrements('id'); $table->string('name',255); + $table->string('country_code'); + $table->string('calling_code'); $table->enum('status', ['active', 'inactive'])->default('active'); $table->timestamp('created_at')->useCurrent(); $table->timestamp('updated_at')->useCurrent(); From 774276137a2bb8f0504a242655978411a5c5240d Mon Sep 17 00:00:00 2001 From: mrprotocoll Date: Wed, 4 Oct 2023 23:10:39 +0100 Subject: [PATCH 3/3] Update migration stub and country model stub --- src/resources/stubs/Models/Country.stub | 2 +- .../2014_02_04_000000_create_country_state_city_table.stub | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/resources/stubs/Models/Country.stub b/src/resources/stubs/Models/Country.stub index be7ef5e..d42d052 100644 --- a/src/resources/stubs/Models/Country.stub +++ b/src/resources/stubs/Models/Country.stub @@ -12,7 +12,7 @@ class Country extends Model use SoftDeletes; protected $fillable = [ - 'id', 'name', 'country_code', 'calling_code', 'status' + 'id', 'name', 'currency_code', 'calling_code', 'status' ]; public function states(): HasMany diff --git a/src/resources/stubs/migrations/2014_02_04_000000_create_country_state_city_table.stub b/src/resources/stubs/migrations/2014_02_04_000000_create_country_state_city_table.stub index fab8a52..434ca9b 100644 --- a/src/resources/stubs/migrations/2014_02_04_000000_create_country_state_city_table.stub +++ b/src/resources/stubs/migrations/2014_02_04_000000_create_country_state_city_table.stub @@ -17,7 +17,7 @@ class CreateCountryStateCityTable extends Migration Schema::create('countries', function (Blueprint $table) { $table->bigIncrements('id'); $table->string('name',255); - $table->string('country_code'); + $table->string('currency_code'); $table->string('calling_code'); $table->enum('status', ['active', 'inactive'])->default('active'); $table->timestamp('created_at')->useCurrent();