ClosureValidationRule
in package
implements
Rule
Interfaces, Classes and Traits
Table of Contents
- $callback : Closure
- The callback that validates the attribute.
- $failed : bool
- Indicates if the validation callback failed.
- $message : string|null
- The validation error message.
- __construct() : void
- Create a new Closure based validation rule.
- message() : string
- Get the validation error message.
- passes() : bool
- Determine if the validation rule passes.
Properties
$callback
The callback that validates the attribute.
public
Closure
$callback
$failed
Indicates if the validation callback failed.
public
bool
$failed
= false
$message
The validation error message.
public
string|null
$message
Methods
__construct()
Create a new Closure based validation rule.
public
__construct(Closure $callback) : void
Parameters
- $callback : Closure
Return values
void —message()
Get the validation error message.
public
message() : string
Return values
string —passes()
Determine if the validation rule passes.
public
passes(string $attribute, mixed $value) : bool
Parameters
- $attribute : string
- $value : mixed