chrgriffin/laravel-strict-validator
Composer 安装命令:
composer require chrgriffin/laravel-strict-validator
包简介
'Strict' validator for PHP arrays. Currently only supported in Laravel.
README 文档
README
'Strict' validator for PHP arrays. Currently only supported in Lumen/Laravel as it uses the Laravel validation implementation. Use this package to add 'strict' validation in addition to the normal Laravel validation rules.
'Strict' Rules
- Arrays can only contain fields under validation. Any 'extra' indexes will cause the validator to return
false. - to be continued..?
Installation
composer require chrgriffin/laravel-strict-validator
Usage
use ChrGriffin\StrictValidator;
$validator = new StrictValidator(
$dataToValidate,
[
'foo' => 'string|required',
'bar' => 'array|required',
'bar.inner' => 'string|required'
]
);
$valid = $validator->validate();
统计信息
- 总下载量: 153
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2018-05-15