Conditions | 2 |
Paths | 2 |
Total Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
29 | protected function failedValidation(Validator $validator) |
||
30 | { |
||
31 | |||
32 | if (strpos($this->path(),'api') !== false) { |
||
33 | $errors = (new ValidationException($validator))->errors(); |
||
34 | throw new HttpResponseException(response()->json(['success' => false, 'errors' => $errors, |
||
35 | ], JsonResponse::HTTP_UNPROCESSABLE_ENTITY)); |
||
36 | } |
||
37 | } |
||
38 | |||
43 |