ClosureValidationRule
class ClosureValidationRule implements Rule, ValidatorAwareRule
Traits
Properties
| protected Closure | $destructor | The callback to call when the object destructs. |
from CreatesPotentiallyTranslatedStrings |
| bool | $failed | Indicates if the validation callback failed. |
|
| array | $messages | The validation error messages. |
|
| protected Validator|null | $validator | The current validator. |
Methods
pendingPotentiallyTranslatedString(string $attribute, string|null $message)
Create a pending potentially translated string.
bool
passes(string $attribute, mixed $value)
Determine if the validation rule passes.
array|string
message()
Get the validation error messages.
Details
in
CreatesPotentiallyTranslatedStrings at line 15
protected PotentiallyTranslatedString
pendingPotentiallyTranslatedString(string $attribute, string|null $message)
Create a pending potentially translated string.
at line 37
__construct(Closure $callback)
Create a new Closure based validation rule.
in
CreatesPotentiallyTranslatedStrings at line 40
__destruct()
Handle the object's destruction.
at line 45
bool
passes(string $attribute, mixed $value)
Determine if the validation rule passes.
at line 61
array|string
message()
Get the validation error messages.
at line 69
ValidatorAwareRule
setValidator(Validator $validator)
Set the current validator.