lbacik/value-object-illuminate-validation
Composer 安装命令:
composer require lbacik/value-object-illuminate-validation
包简介
Validator wrapper (to be used with ValueObject) for Illuminate Validation class
README 文档
README
Validator wrapper (to be used with ValueObject) for Illuminate Validation class
ValueObject implementation: https://github.com/lbacik/value-object
Laravel documentation about using Laravel's validator features: https://laravel.com/docs/5.7/validation
Example value object declaration:
class ExampleValueObject extends ValueObject
{
protected $validators = [
KeysValidator::class,
IlluminateValidationValidator::class,
];
protected $keys = [
'id' => 'required|integer|min:1',
'name' => 'required|string|max:5',
'desc' => 'nullable|string|max:100',
];
}
Value object creation and (instant) validation:
$vo = new ExampleValueObject([
'id' => 1,
'name' => 'Ala',
'desc' => 'Sample description',
])
For more examples please check the project's tests!
统计信息
- 总下载量: 934
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: LGPL-3.0-or-later
- 更新时间: 2018-09-27