adaptivemedia / laravel-pnr-validator
Validate a swedish personnummer in Laravel
Installs: 11 009
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 1
Open Issues: 0
Requires
- php: >=7.4
- illuminate/support: ^7|^8|^9
- illuminate/translation: ^7|^8|^9
- illuminate/validation: ^7|^8|^9
Requires (Dev)
- mockery/mockery: ^1.0
- orchestra/testbench: ^5.3|^v6.0.0
- phpunit/phpunit: ^8.0|^9
README
Installation
Install the package with Composer via the command line:
composer require adaptivemedia/laravel-pnr-validator
This package has auto discovery so you don't need to add the Service Provider.
Usage
Use it like any Validator
rule:
$rules = [ 'field' => 'pnr', ];
$rules = [ 'field' => new PersonalIdentityNumber() ];
See the Validation documentation of Laravel.
Valid formats
- YYYYMMDD-XXXX
- YYMMDD-XXXX
- YYYYMMDDXXXX
- YYMMDDXXXX
- XXXXXX-XXXX (organization, TODO)
- XXXXXXXXXX (organization, TODO)