Conditions | 2 |
Paths | 2 |
Total Lines | 12 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
16 | public function validateItem(array $values): array |
||
17 | { |
||
18 | $validator = Validator::make($this->values($values), [ |
||
19 | 'title' => 'required|string|min:5', |
||
20 | 'notes' => 'nullable|string', |
||
21 | ]); |
||
22 | |||
23 | if($validator->fails()) |
||
24 | { |
||
25 | throw new ValidationException($validator); |
||
26 | } |
||
27 | return $validator->validated(); |
||
28 | } |
||
30 |