runner / validation
Installs: 9 552
Dependents: 1
Suggesters: 0
Security: 0
Stars: 3
Watchers: 2
Forks: 3
Open Issues: 0
Requires
- php: >=5.6
- fastd/fastd: ~3.1
- runner/fastd-eloquent: ~1.0.0
- runner/validator: ~0.1
Requires (Dev)
- phpunit/phpunit: ^5.0
README
使用
创建请求验证器
use Runner\Validation\RequestValidatorInterface;
class OrderStoreRequestValidator implements RequestValidatorInterface
{
public function rules()
{
return [
'price' => 'required|numeric'
];
}
}
配置绑定路由
#file: config/config.php
return [
'validation' => [
'orders.store' => OrderStoreRequestValidator::class
],
];