Fix $tag object getting overriden by last array item

This commit is contained in:
SychO9 2021-05-16 23:53:34 +01:00
parent bcb5577de5
commit 3635dbad19

View File

@ -82,8 +82,9 @@ class Tag
$tagsDocument = $this->getTagsDocument($request, $slug);
$apiDocument->included[] = $tagsDocument->data;
foreach ((array) $tagsDocument->included as $tag) {
$apiDocument->included[] = $tag;
$includedTags = $tagsDocument->included;
foreach ((array) $includedTags as $includedTag) {
$apiDocument->included[] = $includedTag;
}
$document->title = $tag->name;