It is often or not we need a country listing in our package to display in the view or dropdown HTML component. Instead of creating table of coutries we could use a proven PHP package library to do that.
I come across this library league/iso3166 and have use it ever since.
Methods you can use are:
I come across this library league/iso3166 and have use it ever since.
Methods you can use are:
#to define the library
use League\ISO3166\ISO3166;
#to get all countries
$countries = (new ISO3166())->all();
#to get a specific country details and currency for Philippines
$country => (new ISO3166())->alpha3('PHL');
#to get a specific country name for Philippines
$country_name' => ((new ISO3166())->alpha3('PHL'))['name'];