Skip to content

Commit

Permalink
Merge branch 'release/5.0.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
lindyhopchris committed Jan 11, 2025
2 parents e2f6696 + a0a50f0 commit 63d8c4c
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 1 deletion.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file. This projec

## Unreleased

## [5.0.2] - 2025-01-11

### Fixed

- [#23](https://github.com/laravel-json-api/core/pull/23) Ensure relationship meta is included in paginated relationship
responses.

## [5.0.1] - 2024-11-30

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion src/Core/Responses/Concerns/HasRelationship.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
2 changes: 2 additions & 0 deletions src/Core/Responses/Internal/PaginatedIdentifierResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()
);
}
Expand Down

0 comments on commit 63d8c4c

Please sign in to comment.