andersao / andersao/l5-repository

How to use rule objects in validation?

Open
#746 1 comment 0 reactions 0 assignees View on GitHub
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.