src/Serializers/Hateoas/HateoasSerializer.php
protected function fixRelations(array $data): array
    {
        $links = [];

        if (array_key_exists('relations', $data)) {
            $links = array_merge($links, $data['relations']);
            unset($data['relations']);
        }

        if (array_key_exists('actions', $data)) {
            $links = array_merge($links, $data['actions']);
            unset($data['actions']);
        }

        if (count($links)) {
            $data['_links'] = $links;
        }

        return $data;
    }
protected function fixRelations(array $data): array
    {
        $links = [];

        if (array_key_exists('relations', $data)) {
            $links = array_merge($links, $data['relations']);
            unset($data['relations']);
        }

        if (array_key_exists('actions', $data)) {
            $links = array_merge($links, $data['actions']);
            unset($data['actions']);
        }

        if (count($links)) {
            $data['_links'] = $links;
        }

        return $data;
    }
protected function fixRelations ( array $ data ) : array { $ links = [ ] ; if ( array_key_exists ( 'relations' , $ data ) ) { $ links = array_merge ( $ links , $ data [ 'relations' ] ) ; unset ( $ data [ 'relations' ] ) ; } if ( array_key_exists ( 'actions' , $ data ) ) { $ links = array_merge ( $ links , $ data [ 'actions' ] ) ; unset ( $ data [ 'actions' ] ) ; } if ( count ( $ links ) ) { $ data [ '_links' ] = $ links ; } return $ data ; }
Fix relations after normalization

@param array $data

@return array
Fix relations after normalization