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

$callback Closure

The callback that validates the attribute.

Default: null
public

$failed bool

Indicates if the validation callback failed.

Default: false
public

$messages array

The validation error messages.

Default: []
protected

$validator Validator

The current validator.

Default: null

Methods

public

__construct ( $callback ) : void

Create a new Closure based validation rule.

Parameters

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