andersao / andersao/l5-repository
How to use rule objects in validation?
Open
- Dominant language
- PHP
- Stars
- 4.2k
- Forks
- 880
- PR merge metrics
- No merged PRs in 30d
Description
How to use rule objects in validation? I wrote an example below:
class PatientValidator extends LaravelValidator {
/**
* Validation Rules
*
* @var array
*/
protected $rules = [
ValidatorInterface::RULE_CREATE => [ new Cpf ],
ValidatorInterface::RULE_UPDATE => [],
];
}
It is possible to use with FormRequests, however with l5-repository it was not possible, but I need it. How can I do this?
Contributor guide
Assessment
This issue has not been assessed yet.