laravel-liberu / cnp-validator
Romanian CNP validator for Laravel
Fund package maintenance!
laravel-liberu
Requires
- php: >=8.0
- laravel/framework: ^8.0|^9.0
- dev-master
- v9.0.2
- 3.0.0
- v2.1.6
- v2.1.5
- v2.1.4
- v2.1.3
- v2.1.2
- v2.1.1
- 2.1.0
- 2.0.3
- 2.0.2
- 2.0.1
- 2.0.0
- 1.4.3
- 1.4.2
- 1.4.1
- 1.4.0
- 1.3.13
- 1.3.12
- 1.3.11
- 1.3.10
- 1.3.9
- 1.3.8
- 1.3.7
- 1.3.6
- 1.3.5
- 1.3.4
- 1.3.3
- 1.3.2
- 1.3.1
- 1.3.0
- 1.2.1
- 1.2.0
- 1.1.9
- 1.1.8
- 1.1.7
- 1.1.6
- 1.1.5
- 1.1.4
- 1.1.3
- 1.1.2
- 1.1.1
- 1.1.0
- 1.0.7
- 1.0.6
- 1.0.5
- 1.0.4
- 1.0.3
- 1.0.2
- 1.0.1
- 1.0.0
This package is auto-updated.
Last update: 2024-08-13 03:09:16 UTC
README
CNP Validator
Romanian CNP validator for Laravel
Instalation Steps
-
Add
'LaravelLiberu\CnpValidator\CnpValidatorServiceProvider::class'
to your providers list in config/app.php. -
Use the CNP validator in your ValidateModelRequest validation class
public function rules() { return [ 'cnp' => [ 'max:13', 'cnp', 'nullable', request()->getMethod() == 'PATCH' ? Rule::unique('users', 'nin')->ignore(route('user')->id) : Rule::unique('users', 'nin') ], ]; }
Notes
Don't forget to add the translation for the validator error message in resources/lang/**/validation.php
under the cnp
key.
The Laravel Liberu Core package comes with this package included.
Contributions
are welcome. Pull requests are great, but issues are good too.
License
This package is released under the MIT license.