public static function countryAlpha2(string $country) : string
    {
        $alpha2 = static::simpleCountries()->filter(function ($c) use ($country) {
            return $c === $country;
        })->keys()->first();

        return $alpha2 ? $alpha2 : 'Unknown';
    }
public static function countryAlpha2(string $country) : string
    {
        $alpha2 = static::simpleCountries()->filter(function ($c) use ($country) {
            return $c === $country;
        })->keys()->first();

        return $alpha2 ? $alpha2 : 'Unknown';
    }
public static function countryAlpha2 ( string $ country ) : string { $ alpha2 = static :: simpleCountries ( ) -> filter ( function ( $ c ) use ( $ country ) { return $ c === $ country ; } ) -> keys ( ) -> first ( ) ; return $ alpha2 ? $ alpha2 : 'Unknown' ; }
Returns the country alpha2 ISO code.

@author Erik Campobadal Fores <soc@erik.cat>
@copyright 2017 erik.cat
@param string $country
@return string
Returns the country alpha2 ISO code .