Created
March 12, 2020 01:21
-
-
Save jaggy/3295d112abc933d3da6b0937bd9a21f5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
protected function invalidJson($request, ValidationException $exception) | |
{ | |
return response()->json([ | |
'message' => $exception->getMessage(), | |
'errors' => Collection::make($exception->errors())->mapWithKeys(function ($value, $key) { | |
return [Str::camel($key) => $value]; | |
}), | |
], $exception->status); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment