diff --git a/src/Core/Responses/Concerns/HasRelationship.php b/src/Core/Responses/Concerns/HasRelationship.php index cf7f3eb..333ed10 100644 --- a/src/Core/Responses/Concerns/HasRelationship.php +++ b/src/Core/Responses/Concerns/HasRelationship.php @@ -48,7 +48,7 @@ private function allMeta(): ?Hash * * @return array|null */ - private function metaForRelationship(): ?array + protected function metaForRelationship(): ?array { if ($this->hasRelationMeta && $relation = $this->relation()) { return $relation->meta(); diff --git a/src/Core/Responses/Internal/PaginatedIdentifierResponse.php b/src/Core/Responses/Internal/PaginatedIdentifierResponse.php index 619bf1c..df6f47f 100644 --- a/src/Core/Responses/Internal/PaginatedIdentifierResponse.php +++ b/src/Core/Responses/Internal/PaginatedIdentifierResponse.php @@ -43,6 +43,8 @@ public function __construct(JsonApiResource $resource, string $fieldName, Page $ public function meta(): Hash { return Hash::cast($this->page->meta())->merge( + Hash::cast(parent::metaForRelationship()) + )->merge( parent::meta() ); } diff --git a/src/Core/Responses/Internal/PaginatedRelatedResourceResponse.php b/src/Core/Responses/Internal/PaginatedRelatedResourceResponse.php index 3391687..d7a9ea8 100644 --- a/src/Core/Responses/Internal/PaginatedRelatedResourceResponse.php +++ b/src/Core/Responses/Internal/PaginatedRelatedResourceResponse.php @@ -43,6 +43,8 @@ public function __construct(JsonApiResource $resource, string $fieldName, Page $ public function meta(): Hash { return Hash::cast($this->page->meta())->merge( + Hash::cast(parent::metaForRelationship()) + )->merge( parent::meta() ); }