laravel / 10 / api / 10.x / illuminate / validation / rules / enum.html

Enum

class Enum implements Rule (View source)

Properties

protected string $type

The type of the enum.

Methods

void __construct(string $type)

Create a new rule instance.

bool passes(string $attribute, mixed $value)

Determine if the validation rule passes.

string|array message()

Get the validation error message.

Details

void __construct(string $type)

Create a new rule instance.

Parameters

string $type

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/10.x/Illuminate/Validation/Rules/Enum.html