class
Illuminate
/
Validation
/
ClosureValidationRule
You're browsing the documentation for an upcoming version of Laravel. The documentation and features of this release are subject to change.
ClosureValidationRule
Implements
Uses
Properties
public
$failed bool
Indicates if the validation callback failed.
Default: false
public
$messages array
The validation error messages.
Default: []
Methods
public
__construct ( $callback ) : void
Create a new Closure based validation rule.
Parameters
- $callback Closure
public
passes ( $attribute , $value ) : bool
Determine if the validation rule passes.
Parameters
- $attribute string
- $value mixed
public
message ( ) : string
Get the validation error messages.
public
setValidator ( $validator ) : $this
Set the current validator.
Parameters
- $validator Validator