Starting with version 3.0.0, all notable changes will be documented in this file following the Keep a Changelog format. This project adheres to Semantic Versioning.
3.3.0 - 2024-07-22
3.2.0 - 2023-02-17
- Added Laravel 10 support
3.1.0 - 2022-02-18
- Added support for PHP 8 and Laravel 9
- Add 'orFail' variants of country and administrative area methods
- Added
Macroable
to entities
- Dropped support for older PHP and Laravel versions
- Switched to PHP 7.4 syntax (more usage of type hints)
- Switched to GitHub actions for CI
- Implemented Get a Changelog standard
- Added support for accessing values as attributes (i.e.
$country->country_code
as well as$country->getCountryCode()
) - Added additional tests
- Updated the collection methods to support Laravel's new
pop($count)
method signature
We introduced the Keep a Changelog format with version 3.0.0. For versions 2.2.1 and below, see the Github Releases and the old release notes below:
This release adds Laravel 7 support and also is more permissive in its validators:
- If we don't have a known list of administrative areas for a country, we just allow any value
- If a country does not require an administrative area, we allow an empty string
- If a country does not require a postal code, we allow an empty string
(The 2.0.0 release had a bug that failed to allow admin areas when we don't have data.)
This is the first stable release, with lots of breaking changes since 0.5.*
- Minimum supported Laravel version is now
5.7
and the minimum supported PHP version is now7.1.3
Galahad\LaravelAddressing\ServiceProvider
has been moved toGalahad\LaravelAddressing\Support\AddressingServiceProvider
, so if you were manually registering the service provider, please update yourapp.php
config file.Galahad\LaravelAddressing\Facades\Addressing
has been moved toGalahad\LaravelAddressing\Support\Facades\Addressing
, so if you were manually registering the service provider, please update yourapp.php
config file.- The previously-deprecated
Galahad\LaravelAddressing\AddressFacade
has been removed - All custom repository classes (
AddressFormatRepository
,AdministrativeAreaRepository
,CountryRepository
) have been removed. Instead, countries are accessed via the facade orLaravelAddressing
class, and everything else is loaded via its parent. - Most custom methods have been removed from
CountryCollection
andAdministrativeAreaCollection
(getCountryCode()
, etc) in favor of just callinggetCountry()
on the collection and then accessing the Country entity directly. LaravelAddressing::getCountryList()
has been removed in favor ofcountries()->toSelectArray()
Country::getAdministrativeAreasList()
has been removed in favor ofadministrativeAreas()->toSelectArray()
Entity\Country
no longer extendsCommerceGuys\Addressing\Country
(which is now afinal
class), and instead provides a similar/decorated APIEntity\AdministrativeArea
no longer extendsCommerceGuys\Addressing\Subdivision\Subdivision
, and instead extendsEntity\Subdivision
and provides a similar/decorated API- Administrative areas are no longer keyed by compound codes (i.e.
US-PA
) and instead by their country-specific codes (i.e.PA
) Galahad\LaravelAddressing\Controller
has been split up into separate controllers. If you're extending this, please see theSupport/Http/
directory.$country->getPostalCodePattern()
has been removed in favor of$country->addressFormat()->getPostalCodePattern()
- All validation logic has been refactored. The API is the same as long as you were using string-based validations (i.e.
'country_input' => 'country_code'
). If not, seesrc/Support/Validation/
for details. - The
/{country}/administrative-areas
HTTP endpoint no longer returns anexpected_length
value andcountry
has been renamed tocountry_code
- The config
addressing.route.prefix
has been renamedaddressing.routes.prefix
andaddressing.routes.enabled
has been added - The
UnknownCountryException
is no longer thrown, andNULL
is returned instead
Added
for new featuresChanged
for changes in existing functionalityDeprecated
for soon-to-be removed featuresRemoved
for now removed featuresFixed
for any bug fixesSecurity
in case of vulnerabilities