¨4.0.1¨

This commit is contained in:
¨NW¨
2023-12-03 14:07:47 +00:00
parent c08b36d1b6
commit f35052522d
1112 changed files with 43019 additions and 24987 deletions

View File

@@ -25,6 +25,18 @@ class Country
*/
private static $supported;
/**
* Get all country codes.
*
* @return array
*/
public static function codes()
{
return array_keys(self::all());
}
/**
* Get all countries.
*
@@ -39,33 +51,6 @@ class Country
return self::$countries;
}
/**
* Get all supported countries.
*
* @return array
*/
public static function supported()
{
if (! is_null(self::$supported)) {
return self::$supported;
}
$supportedCountries = setting('supported_countries');
return self::$supported = array_filter(static::all(), function ($code) use ($supportedCountries) {
return in_array($code, $supportedCountries);
}, ARRAY_FILTER_USE_KEY);
}
/**
* Get all country codes.
*
* @return array
*/
public static function codes()
{
return array_keys(self::all());
}
/**
* Get supported country codes.
@@ -77,10 +62,31 @@ class Country
return array_keys(self::supported());
}
/**
* Get all supported countries.
*
* @return array
*/
public static function supported()
{
if (!is_null(self::$supported)) {
return self::$supported;
}
$supportedCountries = setting('supported_countries');
return self::$supported = array_filter(static::all(), function ($code) use ($supportedCountries) {
return in_array($code, $supportedCountries);
}, ARRAY_FILTER_USE_KEY);
}
/**
* Get name of the given country code.
*
* @param string $code
*
* @return string
*/
public static function name($code)