Skip to content

Releases: robertogallea/laravel-codicefiscale

3.0.0

Choose a tag to compare

@robertogallea robertogallea released this 12 Aug 08:03

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 a Robertogallea\CodiceFiscale\Laravel integration layer.
  • An immutable CodiceFiscale value object, constructed via from()/tryFrom(), that can only ever hold a structurally valid code.
  • Generator, taking a Person DTO (real DateTimeImmutable, BirthPlaceCode, Gender enum) instead of loosely-typed positional arguments.
  • Parser, decoding a CodiceFiscale into surnameCode()/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 a ValidationResult carrying every applicable ValidationError, instead of one exception at a time.
  • Matcher, comparing a CodiceFiscale against a Person/PartialPerson and reporting matched/mismatched/skipped fields explicitly.
  • Omocodia, exposing canonical(), variants() (all 128 combinations), and isEquivalentTo().
  • A BirthPlace domain 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-places artisan 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.

2.3.0

Choose a tag to compare

@robertogallea robertogallea released this 04 Sep 07:00
Fix styling

v2.0.2

Choose a tag to compare

@robertogallea robertogallea released this 22 Jul 08:44
Fix styling

2.0.0

Choose a tag to compare

@robertogallea robertogallea released this 14 Jun 07:14
  • Add Faker provider for generating total or partial generation of codice fiscale
  • Add support for Carbon 3
  • Minor refactoring

1.12.1

Choose a tag to compare

@robertogallea robertogallea released this 25 Nov 08:09
35a2087
Add missing city (#55)

* Add 'I719' => 'SIAMANNA SIAPICCIA',

* Add 'I719' => 'SIAMANNA SIAPICCIA',

1.10.1

Choose a tag to compare

@robertogallea robertogallea released this 25 Oct 13:07
14118c0
Merge pull request #37 from robertogallea/add_configurable_labels_and…

1.9.1

Choose a tag to compare

@robertogallea robertogallea released this 15 Oct 06:32
531a45d
Merge pull request #32 from michelepizzi/master

add other cities from A001 to A099 and F888

1.9.0

Choose a tag to compare

@robertogallea robertogallea released this 28 Sep 13:30

You can now validate your codice fiscale against other form fields to check whether there is a match
or not.

You must specify all of the required fields:

  • first_name
  • last_name
  • birthdate
  • place
  • gender

giving parameters to the codice_fiscale rule.

For example:

    public function rules()
    {
        return [
            'codicefiscale' => 'codice_fiscale:first_name=first_name_field,last_name=last_name_field,birthdate=birthdate_field,place=place_field,gender=gender_field',
            'first_name_field' => 'required|string',
            'last_name_field' => 'required|string',
            'birthdate_field' => 'required|date',
            'place_field' => 'required|string',
            'gender_field' => 'required|string|max:1',
        ];
    }

Validation fails if the provided codicefiscale and the one generated from the input fields do not match.

1.8.2

Choose a tag to compare

@robertogallea robertogallea released this 27 Sep 12:21
097f23b
Merge pull request #30 from michelepizzi/master

H397 code for an italian city

1.7.2

Choose a tag to compare

@robertogallea robertogallea released this 11 Aug 10:55
68a1333
Merge pull request #25 from halservice/custom

Added C171