Total Complexity | 2 |
Total Lines | 18 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
7 | class ValidDuplicate implements Rule |
||
8 | { |
||
9 | /** |
||
10 | * Check duplicate value. |
||
11 | */ |
||
12 | public function passes($attribute, $value): bool |
||
13 | { |
||
14 | $value = str_split($value); |
||
15 | |||
16 | return collect($value)->duplicates()->isEmpty(); |
||
|
|||
17 | } |
||
18 | |||
19 | /** |
||
20 | * Get the validation error message. |
||
21 | */ |
||
22 | public function message(): string |
||
25 | } |
||
26 | } |
||
27 |