Skip to content

Commit 63d8c4c

Browse files
committed
Merge branch 'release/5.0.2'
2 parents e2f6696 + a0a50f0 commit 63d8c4c

File tree

4 files changed

+12
-1
lines changed

4 files changed

+12
-1
lines changed

CHANGELOG.md

+7
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file. This projec
55

66
## Unreleased
77

8+
## [5.0.2] - 2025-01-11
9+
10+
### Fixed
11+
12+
- [#23](https://github.com/laravel-json-api/core/pull/23) Ensure relationship meta is included in paginated relationship
13+
responses.
14+
815
## [5.0.1] - 2024-11-30
916

1017
### Fixed

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();

src/Core/Responses/Internal/PaginatedIdentifierResponse.php

+2
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ public function __construct(JsonApiResource $resource, string $fieldName, Page $
4343
public function meta(): Hash
4444
{
4545
return Hash::cast($this->page->meta())->merge(
46+
Hash::cast(parent::metaForRelationship())
47+
)->merge(
4648
parent::meta()
4749
);
4850
}

src/Core/Responses/Internal/PaginatedRelatedResourceResponse.php

+2
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ public function __construct(JsonApiResource $resource, string $fieldName, Page $
4343
public function meta(): Hash
4444
{
4545
return Hash::cast($this->page->meta())->merge(
46+
Hash::cast(parent::metaForRelationship())
47+
)->merge(
4648
parent::meta()
4749
);
4850
}

0 commit comments

Comments
 (0)