cgdsoftware / cnp-validator
Romanian CNP validator for Laravel
v2.1.1
2023-01-27 22:59 UTC
Requires
- php: >=8.0
- laravel/framework: ^8.0|^9.0
- dev-master
- 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
- dev-hotfix/typeValidation
- dev-fixes/stylci
This package is auto-updated.
Last update: 2024-12-16 00:19:26 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.