W3cubDocs

/Laravel 8

ClosureValidationRule

class ClosureValidationRule implements Rule (View source)

Properties

Closure $callback The callback that validates the attribute.
bool $failed Indicates if the validation callback failed.
string|null $message The validation error message.

Methods

void __construct(Closure $callback)

Create a new Closure based validation rule.

bool passes(string $attribute, mixed $value)

Determine if the validation rule passes.

string|array message()

Get the validation error message.

Details

void __construct(Closure $callback)

Create a new Closure based validation rule.

Parameters

Closure $callback

Return Value

void

bool passes(string $attribute, mixed $value)

Determine if the validation rule passes.

Parameters

string $attribute
mixed $value

Return Value

bool

string|array message()

Get the validation error message.

Return Value

string|array

© Taylor Otwell
Licensed under the MIT License.
Laravel is a trademark of Taylor Otwell.
https://laravel.com/api/8.x/Illuminate/Validation/ClosureValidationRule.html