Skip to content

Commit

Permalink
Skip meta fields already mapped
Browse files Browse the repository at this point in the history
  • Loading branch information
tobyzerner committed Oct 25, 2024
1 parent 3e782b8 commit 9b64b68
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Serializer.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,10 @@ private function addToMap(Resource $resource, mixed $model, array $include): arr

// TODO: cache
foreach ($resource->meta() as $field) {
if (!$field->isVisible($context)) {
if (
array_key_exists($field->name, $this->map[$key]['meta'] ?? []) ||
!$field->isVisible($context)
) {
continue;
}

Expand Down

0 comments on commit 9b64b68

Please sign in to comment.