src/Traits/FormatsValidJsonResponses.php
public function validInternalServerErrorJsonResponse($exception, $message = 'Error')
    {
        return response()->json(
            [
                'exception' => class_basename($exception),
                'file' => basename($exception->getFile()),
                'line' => $exception->getLine(),
                'message' => $exception->getMessage(),
                'trace' => $exception->getTrace(),
            ], 500, [], JSON_PRETTY_PRINT
        );
    }
public function validInternalServerErrorJsonResponse($exception, $message = 'Error')
    {
        return response()->json(
            [
                'exception' => class_basename($exception),
                'file' => basename($exception->getFile()),
                'line' => $exception->getLine(),
                'message' => $exception->getMessage(),
                'trace' => $exception->getTrace(),
            ], 500, [], JSON_PRETTY_PRINT
        );
    }
public function validInternalServerErrorJsonResponse ( $ exception , $ message = 'Error' ) { return response ( ) -> json ( [ 'exception' => class_basename ( $ exception ) , 'file' => basename ( $ exception -> getFile ( ) ) , 'line' => $ exception -> getLine ( ) , 'message' => $ exception -> getMessage ( ) , 'trace' => $ exception -> getTrace ( ) , ] , 500 , [ ] , JSON_PRETTY_PRINT ) ; }
Return a valid 500 Internal Server Error json response.

@param Exception $exception The exception object.
@param string    $message   The response message.

@return \Illuminate\Http\JsonResponse
Return a valid 500 Internal Server Error json response .