Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Addressing Laravel Package

commerceguys/addressing

A PHP 8+ addressing library powered by CLDR and Google's address data. It provides address formats for 200+ countries, subdivisions, translations, HTML/plain-text formatting, validation via symfony/validator, and zones.

View on GitHub
Deep Wiki
Context7
v2.3.2

What's Changed

New Contributors

Full Changelog: https://github.com/commerceguys/addressing/compare/v2.3.1...v2.3.2

v2.3.1

Two fixes for bugs introduced in v2.3.0:

  • getSubdivisionDepth() returned an error for some address formats due to a lack of a default value.
  • Guatemala (GT) subdivisions were not wired in (missing subdivision_data_fields).

Full Changelog: https://github.com/commerceguys/addressing/compare/v2.3.0...v2.3.1

v2.3.0

Address formats now declare which fields have subdivision data

subdivision_depth has been replaced by subdivision_data_fields, which names the fields directly instead of encoding them as a count (#213):

// Before: 1 meant "administrative areas", 2 meant "administrative areas and localities".
'subdivision_depth' => 1,

// After.
'subdivision_data_fields' => ['administrativeArea'],

AddressFormat now has getSubdivisionDataFields(), replacing getSubdivisionDepth() which is now deprecated. Custom definitions using subdivision_depth are still accepted and converted automatically.

New subdivisions

  • Great Britain — the 217 counties from ISO 3166-2:GB, keyed by ISO code, with Welsh names as translations
  • Guatemala — the 22 departments, contributed by @jgalindosl (#242).

Data corrections

  • AE - optional city field added; the missing hamza restored in the Umm Al Quwain local name.
  • CO - spelling of Guainía.
  • IT - province list updated and sorted alphabetically, thanks to @McAle16 (#237).
  • NG-— the State suffix dropped from Ogun.
  • PE - administrative areas are now labelled as regions, matching ISO 3166-2:PE.
  • RU - the Udmurt Republic now uses its official name.
  • TH - romanization fixed for Chumphon, Phatthalung and Suphan Buri; the changwat prefix dropped from the Bueng Kan local name.
  • TR - Afyon renamed to Afyonkarahisar.
  • VE - Distrito Federal renamed to Distrito Capital, its official and ISO 3166-2 name since 1999; La Guaira moved to its alphabetical position after the rename from Vargas.
  • VN - the city prefix dropped from the Ho Chi Minh local name.

Other improvements

  • Reworked DefaultFormatter's logic for rendering empty fields, fixing bugs where separators were sometimes left behind (affecting CO, GT, JP, MX, PY, TR, UY, VE).
  • Subdivision definitions with a locale now default local_name to name, for less verbosity.
  • Malformed subdivision definition files are ignored instead of raising errors (#246).
  • PostalCodeHelper accepts modifiers in regular expression rules, so /ZE[0-9]/i works (#164).
  • doctrine/collections 3 is now allowed, thanks to @Chris53897 (#241).
  • SubdivisionUpdater mappings for Vietnam now match VN.json, thanks to @eugene-brit (#240), and cover the VN renames shipped in v2.2.5.

Full Changelog: https://github.com/commerceguys/addressing/compare/v2.2.5...v2.3.0

v2.2.5

What's Changed

New Contributors

Full Changelog: https://github.com/commerceguys/addressing/compare/v2.2.4...v2.2.5

v2.2.4

What's Changed

New Contributors

Full Changelog: https://github.com/commerceguys/addressing/compare/v2.2.3...v2.2.4

v2.2.3
v2.2.2

What's Changed

New Contributors

Full Changelog: https://github.com/commerceguys/addressing/compare/v2.2.1...v2.2.2

v2.2.1

What's Changed

  • Update to CLDR v45.
  • Correct suffixes for ukrainian region names (#214)
  • Update UA subdivisions to follow the latest romanization system (and match ISO).

New Contributors

Full Changelog: https://github.com/commerceguys/addressing/compare/v2.2.0...v2.2.1

v2.1.1

Compatible with Symfony 7.0.

Address format changes:

  • Use the Town/City locality type for New Zealand.
  • Rebuild the address format for Kazakhstan.
  • Add subdivisions for Kazakhstan.
  • When uppercasing address lines 1 and 2, uppercase line 3 as well.
v2.1.0
  • Updated to CLDR v44.
  • Fixed the reported currency for countries CU and VG.
  • UK locality_type is now town_city (#200).

Note for integrators: a new locality type was added.

v2.0.0

Changes since v2.0.0-rc1:

  • Removed the postal code prefix for Switzerland. Requested in #96.
  • Added punctuation to the PY/UY address formats, as specified by UPU.
  • Added administrative areas for Paraguay (PY).

Changes since v1.4.3:

  • Added an address line 3 to the data model.
  • Address formats and subdivisions are no longer auto-generated from Google's dataset, allowing us to accept community changes and bug reports.
  • Subdivisions are now always keyed by ISO code when one is available. See the beta1 docs for instructions on updating data.
  • The "additional name" field is now visible for countries that use patronymics.
  • Added administrative areas for 12 countries (BB, CR, EE, FM, HN, KI, PA, PG, PY, SC, UM, ZW).
  • Rebuilt administrative areas for 2 countries (BS, PH).
  • Many smaller address format improvements.
  • Country list now sourced from CLDR v43.
  • Dropped PHP 7 support.
v2.0.0-rc1

Changes since v2.0.0-beta2:

  • Added administrative areas for 8 countries: Barbados (BB), Micronesia (FM), Honduras (HN), Kiribati (KI), Panama (PA), Papua New Guinea (PG), Seychelles (SC), United States Minor Outlying Islands (UM).
  • Renamed VE-X from Vargas to La Guaira.
  • Removed the administrative area field from AS, MP, VI. These are islands and the format was copied from from the parent US one.
  • Removed the administrative area field from CC, CX, HM, NF. These are islands and the format was copied from from the parent AU one.
  • Use 'region' instead of 'oblast' as the administrative area type for BY/UA/RU. All three countries use 'region' when referring to oblasts in English.
v2.0.0-beta2

Please see the v2.0.0-beta1 release notes for a list of all v2.0.0 changes.

Changes since v2.0.0-beta1:

  • Revert the 2.0.0-beta1 changes to Cabo Verde subdivisions. These are islands, not municipalities as defined by ISO, so not all of them have a two-letter code. For the sake of consistency we're going back to specifying the full island name as the ID.
  • Fix several wrong type hints.
  • Make Address type hints non-nullable again. This reverts 8b1bcd45971733e8f4224e539cb92838f18c4d06 from v1.4.1.
v2.0.0-beta1

Major changes

  • Dropped PHP 7 support, started using PHP 8 language features.
  • Added address line 3 to the address data model.
  • Subdivisions are now keyed by ISO code when one is available. See the "Updating data" section for more information.
  • Address formats and subdivisions are no longer auto-generated from Google's dataset, allowing us to accept community changes and bug reports.
  • Updated address formats / subdivisions for 20 countries:
    • The "additional name" field is now visible for countries that use patronymics.
    • Defined subdivisions for Costa Rica (CR), Estonia (EE) and Zimbabwe (ZW).
    • Rebuilt subdivisions for Bahamas (BS) and Philippines (PH).
    • Additional localities defined for South Korea (KR) and Chile (CL).
  • Country list (and translations) updated to CLDR v43.

Updating data

The library now ships with a SubdivisionUpdater.

It can be used in two ways: a) Call SubdivisionUpdater::updateValue($countryCode, $value) to update an address's administrativeArea in a postLoad() event or equivalent place.

b) Use SubdivisionUpdater::getUpdateMap() to get the full list of updates, and use it to generate update queries for your data.

v1.4.2
  • Update to CLDR v42.
  • Allow doctrine/collections ^2.0
  • Fixed Symfony missing type spec messages
  • Fixed PHP 8.1 deprecation warning
v1.4.1

Quick followup to v.1.4.0, improving BC in the Address class by making the type hints nullable.

v1.4.0
  • Now using PHP 7.3 language features and typehints. Thanks @Chris53897!
  • Allows usage with the Symfony 6 validator.
  • Updated subdivisions for CN, ID, KR, TW.
v1.3.0

Country list updated to CLDR v41.

Dropped support for PHP 7.1 and 7.2. Thanks @Chris53897!

v1.2.2

Update to CLDR v40.

v1.2.1

Country list updated to CLDR v39.

Updated subdivisions for India.

v1.2.0

Drops PHP 7.0 support.

Updates subdivisions for CL, CN, IR, KR, RU and address formats for BH, BY, KH, NA.

v1.1.1

Updated the CLDR country list to v38. Updated the filtering of CLDR locales, now matches CLDR's "modern" locale list.

v1.1.0

Deprecates subdivision-level postal code validation. See #147.

Updates the address format for Ireland. Updates the ISO code and postal code pattern for Sud Sardegna (Italy).

v1.0.9
  • Dataset updates for CN, HK, IE, IT, KR, TW, UA.
  • Replace Iporá with Iporã (Brazil, Paraná). Fixes #132.
  • Remove hardcoded strings from address formats. Fixes #137.
  • Subdivision iso code should not default to an empty array. Fixes #143.
v1.0.8

Update the country list to CLDR v37.

v1.0.7

Dropped PHP5 support. Added the canton administrative area type.

v1.0.6

Update the country list to CLDR v36.

v1.0.5

Update the country list to CLDR v35.1

v1.0.4

Update the dataset (NA/RO address formats, AU/IN/KR subdivisions)

v1.0.3

Updated countries to CLDR v35.

Updated subdivisions for Nicaragua.

Improved handling of unknown countries in DefaultFormatter.

v1.0.2

Updated countries to CLDR v34.

Updated the dataset (BY/HM/KZ/SY address formats; CU/CN/IR/MX/PE/PH subdivisions)

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
htinlynn/genius-helper
maco-studios/hephaestus
elmogy/larafast
xeviant/laravel-paystack
gorilladash/laravel-website-sdk
martialbe/flysystem-oss
chondal/3312client
jeroen-g/flickr
opscale-co/nova-genbi
itsjustvita/laravel-retention
tequilarapido/trackit
gregsphotography/site-builder-filament
cabaoctavio/laravel-query-log
gregsphotography/site-builder-components
io-digital/clickatell
snowsoft/laravel-admin
oxygen/auth
relicsoftware/barakah-payment-gateway
tobya/work-with-composer
equipc/laravel-email-validator