Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

return response at failedValidation() in request laravel

protected function failedValidation(Validator $validator)
{
    throw new HttpResponseException(response()->json([
      'errors' => $validator->errors(),
      'status' => false
    ], 422));
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #return #response #request #laravel
ADD COMMENT
Topic
Name
8+7 =