UniqueValueInArray
in package
implements
Rule
Table of Contents
Interfaces
- Rule
Properties
- $fields : array<string|int, string>
Methods
- __construct() : mixed
- UniqueValueInArray constructor.
- message() : string
- passes() : bool
- Will validate the uniqueness against field's value when it's formatted as the following example: <code> [ ['field' => 'value 1', ...], ['field' => 'value 2', ...], ] </code> The 'field' must be included when initiating the Rule.
Properties
$fields
private
array<string|int, string>
$fields
Methods
__construct()
UniqueValueInArray constructor.
public
__construct(array<string|int, string> $uniqueFields) : mixed
Parameters
- $uniqueFields : array<string|int, string>
message()
public
message() : string
Return values
stringpasses()
Will validate the uniqueness against field's value when it's formatted as the following example: <code> [ ['field' => 'value 1', ...], ['field' => 'value 2', ...], ] </code> The 'field' must be included when initiating the Rule.
public
passes(string $attribute, mixed $value) : bool
Parameters
- $attribute : string
- $value : mixed