laravel-enso/cnp-validator
最新稳定版本:3.2.0
Composer 安装命令:
composer require laravel-enso/cnp-validator
包简介
Romanian CNP validator for Laravel
README 文档
README
CNP Validator
Romanian CNP validator for Laravel
Instalation Steps
-
Add
'LaravelEnso\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 Enso 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.
统计信息
- 总下载量: 10.61k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2019-05-16