| Conditions | 2 |
| Paths | 2 |
| Total Lines | 16 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 25 | public function validateItem(array $values): array |
||
| 26 | { |
||
| 27 | $country = strtoupper($this->tenantService->guild()->country_code); |
||
| 28 | $validator = Validator::make($this->values($values), [ |
||
| 29 | 'name' => 'required|string|min:1', |
||
| 30 | 'email' => 'nullable|email', |
||
| 31 | 'phone' => 'nullable|phone:AUTO,' . $country, |
||
| 32 | 'city' => 'nullable|string', |
||
| 33 | 'address' => 'nullable|string', |
||
| 34 | 'registered_at' => 'nullable|date_format:Y-m-d', |
||
| 35 | ]); |
||
| 36 | if($validator->fails()) |
||
| 37 | { |
||
| 38 | throw new ValidationException($validator); |
||
| 39 | } |
||
| 40 | return $validator->validated(); |
||
| 41 | } |
||
| 43 |