return response at failedvalidation 28 29 in request laravel

Solutions on MaxInterview for return response at failedvalidation 28 29 in request laravel by the best coders in the world

showing results for - "return response at failedvalidation 28 29 in request laravel"
Clarice
19 Mar 2017
1protected function failedValidation(Validator $validator)
2{
3    throw new HttpResponseException(response()->json([
4      'errors' => $validator->errors(),
5      'status' => false
6    ], 422));
7}
8
Lennie
28 Feb 2019
1protected function failedValidation(Validator $validator) { 
2        throw new HttpResponseException(response()->json($validator->errors()->all(), 422)); 
3}
4