Update Country class

This commit is contained in:
DariusIII
2018-01-17 13:53:57 +01:00
parent 87360c1dc2
commit 5e227a5f65
2 changed files with 2 additions and 1 deletions
+1
View File
@@ -1,4 +1,5 @@
2018-01-17 DariusIII
* Chg: Update Country class
* Chg: Remove countries table as we will use new package with migration and seeding to populate it
* Chg: Update Country.php
* Chg: Remove $maxage parameter as it is not used in Books class
+1 -1
View File
@@ -39,7 +39,7 @@ class Country
public static function countryCode($country)
{
if (\strlen($country) > 2) {
$code = CountryModel::query()->where('full_name', $country)->first(['iso_3166_2']);
$code = CountryModel::query()->where('full_name', $country)->orWhere('name', $country)->first(['iso_3166_2']);
if ($code !== null && isset($code['iso_3166_2'])) {
return $code['iso_3166_2'];
}