diff --git a/src/Fields/Media.php b/src/Fields/Media.php index 9f9a231d..edaa64bc 100644 --- a/src/Fields/Media.php +++ b/src/Fields/Media.php @@ -233,7 +233,7 @@ public function resolve($resource, $attribute = null) $this->value = $resource->getMedia($collectionName) ->map(function (\Spatie\MediaLibrary\MediaCollections\Models\Media $media) { return array_merge($this->serializeMedia($media), ['__media_urls__' => $this->getConversionUrls($media)]); - }); + })->values(); if ($collectionName) { $this->checkCollectionIsMultiple($resource, $collectionName);