Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
jeddtony authored Mar 1, 2023
2 parents dbd4dd4 + be07fd7 commit 2effc85
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 6 deletions.
15 changes: 10 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@
{
"name": "Tyler Arbon",
"email": "[email protected]"
},
{
"name": "Scott Robinson",
"email": "[email protected]",
"homepage": "http://dor.ky"
}
],
"autoload": {
Expand All @@ -27,12 +32,12 @@
},
"minimum-stability": "stable",
"require": {
"illuminate/contracts": "^5.5|^6.0",
"illuminate/support": "^5.5|^6.0"
"illuminate/contracts": "^5.5|^6.0|^7.0|^8.0|^9.0|^10.0",
"illuminate/support": "^5.5|^6.0|^7.0|^8.0|^9.0|^10.0"
},
"require-dev": {
"phpunit/phpunit": "^7.0|^8.0",
"orchestra/testbench": "^3.5|^4.0"
"phpunit/phpunit": "^7.0|^8.0|^9.0",
"orchestra/testbench": "^3.5|^4.0|^5.0|^7.0|^8.0"
},
"suggest": {}
"suggest": []
}
33 changes: 32 additions & 1 deletion src/Base.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ function __construct(string $country = null)
$v = Validator::make([
"country" => $country,
], [
"country" => "nullable|string|in:US,CA,MX,NG",

"country" => "nullable|string|in:US,CA,MX,BR,NG",
]);

if ($v->fails()) {
Expand Down Expand Up @@ -147,6 +148,35 @@ protected function isAbbr($value, string $country = null): bool
["abbr" => "VER", "name" => "Veracruz de Ignacio de la Llave"],
["abbr" => "YUC", "name" => "Yucatán"],
["abbr" => "ZAC", "name" => "Zacatecas"],
],
"BR" => [
["abbr" => 'AC', "name" => 'Acre'],
["abbr" => 'AL', "name" => 'Alagoas'],
["abbr" => 'AP', "name" => 'Amapá'],
["abbr" => 'AM', "name" => 'Amazonas'],
["abbr" => 'BA', "name" => 'Bahia'],
["abbr" => 'CE', "name" => 'Ceará'],
["abbr" => 'DF', "name" => 'Distrito Federal'],
["abbr" => 'ES', "name" => 'Espírito Santo'],
["abbr" => 'GO', "name" => 'Goiás'],
["abbr" => 'MA', "name" => 'Maranhão'],
["abbr" => 'MT', "name" => 'Mato Grosso'],
["abbr" => 'MS', "name" => 'Mato Grosso do Sul'],
["abbr" => 'MG', "name" => 'Minas Gerais'],
["abbr" => 'PA', "name" => 'Pará'],
["abbr" => 'PB', "name" => 'Paraíba'],
["abbr" => 'PR', "name" => 'Paraná'],
["abbr" => 'PE', "name" => 'Pernambuco'],
["abbr" => 'PI', "name" => 'Piauí'],
["abbr" => 'RR', "name" => 'Roraima'],
["abbr" => 'RO', "name" => 'Rondônia'],
["abbr" => 'RJ', "name" => 'Rio de Janeiro'],
["abbr" => 'RN', "name" => 'Rio Grande do Norte'],
["abbr" => 'RS', "name" => 'Rio Grande do Sul'],
["abbr" => 'SC', "name" => 'Santa Catarina'],
["abbr" => 'SP', "name" => 'São Paulo'],
["abbr" => 'SE', "name" => 'Sergipe'],
["abbr" => 'TO', "name" => 'Tocantins'],
],
"NG" => [
["abbr" => "AB", "name" => "Abia"],
Expand Down Expand Up @@ -195,6 +225,7 @@ protected function getSubject(string $country = null): string
{
case "US":
case "MX":
case "BR":
case "NG":
return "State";
case "CA":
Expand Down

0 comments on commit 2effc85

Please sign in to comment.