Skip to content

Commit

Permalink
fix: serializer consider meta
Browse files Browse the repository at this point in the history
  • Loading branch information
binaryk committed Sep 16, 2022
1 parent be784a8 commit 7c09251
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Repositories/Serializer.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,9 @@ public function models(Collection $models): self
public function jsonSerialize(): mixed
{
if (is_null($this->items) || $this->items->count() === 1) {
return $this->repository->serializeForShow(
return tap($this->repository->serializeForShow(
$this->request(RepositoryShowRequest::class)
);
), fn(array &$data) => $data['meta'] = array_merge($data['meta'] ?? [], $this->meta));
}

$paginator = new Paginator($this->items->values(), $this->perPage);
Expand Down

0 comments on commit 7c09251

Please sign in to comment.