We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f4f0c62 commit 76e8989Copy full SHA for 76e8989
packages/data/src/Models/StaticCountry.php
@@ -71,6 +71,18 @@ public function timezones()
71
72
public function getFlagIconAttribute(): ?string
73
{
74
- return 'flag-'.strtolower($this->alpha2);
+ $territoryToCountryMap = [
75
+ 'hm' => 'au', // Heard Island and McDonald Islands -> Australia
76
+ 'um' => 'us', // US Minor Outlying Islands -> United States
77
+ 'bq' => 'nl', // Caribbean Netherlands -> Netherlands
78
+ 'bv' => 'no', // Bouvet Island -> Norway
79
+ 'sh' => 'gb', // Saint Helena -> United Kingdom
80
+ 'sj' => 'no', // Svalbard and Jan Mayen -> Norway
81
+ ];
82
+
83
+ $alpha2 = strtolower($this->alpha2);
84
+ $flagCode = $territoryToCountryMap[$alpha2] ?? $alpha2;
85
86
+ return 'flag-' . $flagCode;
87
}
88
0 commit comments