Level 88
This output is being generated in the app/Exceptions/Handler.php class in the render method. This render method class the parent method that handles the display of all exceptions in Laravel. In this case, it's a ValidationException which has its own output.
In your case, you can simply override the invalidJson method
// app/Exceptions/Handler.php
class Handler extends ExceptionHandler
{
// Other methods
protected function invalidJson($request, ValidationException $exception)
{
return response()->json([
'success' => false,
'message' => $exception->getMessage(),
'errors' => $exception->errors(),
], $exception->status);
}
}