src/Api/Response/RestResponseBuilder.php
protected function normalizeErrorResponse($content, $data = null)
    {
        if ($content instanceof Arrayable) {
            $content = $content->toArray();
        }

        if ( ! is_array($content)) {
            $content = [
                'message' => $content,
            ];
        }

        if (null !== $data) {
            $content['data'] = $data;
        }

        return $content;
    }
protected function normalizeErrorResponse($content, $data = null)
    {
        if ($content instanceof Arrayable) {
            $content = $content->toArray();
        }

        if ( ! is_array($content)) {
            $content = [
                'message' => $content,
            ];
        }

        if (null !== $data) {
            $content['data'] = $data;
        }

        return $content;
    }
protected function normalizeErrorResponse ( $ content , $ data = null ) { if ( $ content instanceof Arrayable ) { $ content = $ content -> toArray ( ) ; } if ( ! is_array ( $ content ) ) { $ content = [ 'message' => $ content , ] ; } if ( null !== $ data ) { $ content [ 'data' ] = $ data ; } return $ content ; }
Normalizes error response to array.

@param mixed       $content
@param null|array  $data     extra data to provide in the error message
@return array
Normalizes error response to array .