3.0 is a ground-up rewrite, and an intentional, clean break from 2.x with no compatibility shims. See UPGRADE.md for a complete call-by-call migration table.
Added
- A small, framework-agnostic domain core (
Robertogallea\CodiceFiscale) with no Laravel dependency, separate from aRobertogallea\CodiceFiscale\Laravelintegration layer. - An immutable
CodiceFiscalevalue object, constructed viafrom()/tryFrom(), that can only ever hold a structurally valid code. Generator, taking aPersonDTO (realDateTimeImmutable,BirthPlaceCode,Genderenum) instead of loosely-typed positional arguments.Parser, decoding aCodiceFiscaleintosurnameCode()/nameCode()(honestly named as encoded fragments, not real names), birth date/gender/birthplace, with automatic reference-date resolution of the ambiguous two-digit birth year.Validator, with independently-callable format/checksum/semantics tiers and aValidationResultcarrying every applicableValidationError, instead of one exception at a time.Matcher, comparing aCodiceFiscaleagainst aPerson/PartialPersonand reporting matched/mismatched/skipped fields explicitly.Omocodia, exposingcanonical(),variants()(all 128 combinations), andisEquivalentTo().- A
BirthPlacedomain backed by real ANPR (Italian municipalities) and MAECI (foreign countries) government data, with genuine historical validity windows - a renamed or merged municipality now resolves correctly against a birth date from before the change. - A
codice-fiscale:update-placesartisan command that downloads both datasets into the consuming application's own dedicated SQLite database - never bundled with the package, never touching the host application's primary database. CodiceFiscaleCast(Eloquent attribute casting),CodiceFiscaleRule::make()->matching(...)(fluent cross-field validation), and a Faker provider - all rebuilt on the new core API.- Restored, localized (
en/it) validation error messages.
Removed
- The entire 2.x API (
robertogallea\LaravelCodiceFiscale\*) - no backward-compatibility shims. See UPGRADE.md. - Bundled birthplace data - nobody had verified the redistribution terms of the source datasets, so shipping a converted copy meant redistributing it under this package's own unverified authority.
Note for early adopters
If you were requiring the pre-release dev-dev branch directly, switch to ^3.0 now that a tagged release exists.