Refactor state grouping by country
This commit is contained in:
parent
1bc6ea72e8
commit
336284ee6e
|
|
@ -584,8 +584,8 @@ class Core
|
|||
{
|
||||
$collection = [];
|
||||
|
||||
foreach ($this->countries() as $country) {
|
||||
$collection[$country->code] = $this->states($country->code)->toArray();
|
||||
foreach ($this->countryStateRepository->all() as $state) {
|
||||
$collection[$state->country_code][] = $state->toArray();
|
||||
}
|
||||
|
||||
return $collection;
|
||||
|
|
|
|||
Loading…
Reference in New Issue