Skip to content

Commit 6e1ce42

Browse files
author
Gregory Haddow
committed
fix: custom relationship meta not returned on PaginatedRelatedResourceResponse or PaginatedIdentifierResponse
1 parent f673e0e commit 6e1ce42

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

Diff for: src/Core/Responses/Concerns/HasRelationship.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ private function allMeta(): ?Hash
4848
*
4949
* @return array|null
5050
*/
51-
private function metaForRelationship(): ?array
51+
protected function metaForRelationship(): ?array
5252
{
5353
if ($this->hasRelationMeta && $relation = $this->relation()) {
5454
return $relation->meta();

Diff for: src/Core/Responses/Internal/PaginatedIdentifierResponse.php

+2
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ public function meta(): Hash
4444
{
4545
return Hash::cast($this->page->meta())->merge(
4646
parent::meta()
47+
)->merge(
48+
Hash::cast(parent::metaForRelationship())
4749
);
4850
}
4951

Diff for: src/Core/Responses/Internal/PaginatedRelatedResourceResponse.php

+2
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ public function meta(): Hash
4444
{
4545
return Hash::cast($this->page->meta())->merge(
4646
parent::meta()
47+
)->merge(
48+
Hash::cast(parent::metaForRelationship())
4749
);
4850
}
4951

0 commit comments

Comments
 (0)