From fb7f70fb127a3cd4346d0d42bc26f9a1e7a41f24 Mon Sep 17 00:00:00 2001 From: Philipp Lang Date: Tue, 14 Mar 2023 11:35:24 +0100 Subject: [PATCH] add fallback for nbo conversion --- src/MediaData.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/MediaData.php b/src/MediaData.php index d459f57..8bc82c0 100644 --- a/src/MediaData.php +++ b/src/MediaData.php @@ -39,9 +39,10 @@ class MediaData extends Data public static function fromMedia(Media $media): self { - $conversions = collect($media->getMediaConversionNames())->flip()->map(fn ($integer, $conversion) => [ - 'original_url' => $media->getFullUrl($conversion), - ]); + $conversions = collect($media->getMediaConversionNames())->flip()->map(fn ($integer, $conversion) => $media->hasGeneratedConversion($conversion) + ? ['original_url' => $media->getFullUrl($conversion)] + : null, + ); return self::withoutMagicalCreationFrom([ ...$media->toArray(),