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:
#to define the library
use League\ISO3166\ISO3166;
#to get all countries
$countries...