diff --git a/src/DeferredMediaData.php b/src/DeferredMediaData.php index ddedd9d..d193a40 100644 --- a/src/DeferredMediaData.php +++ b/src/DeferredMediaData.php @@ -45,6 +45,7 @@ class DeferredMediaData extends Data 'size' => $file->getSize(), 'file_name' => $file->getFilename(), 'mime_type' => $file->getMimeType(), + 'icon' => Storage::disk('public')->url('filetypes/' . str()->slug($file->getMimeType()) . '.svg'), ]; } diff --git a/tests/Feature/DeferredUploadTest.php b/tests/Feature/DeferredUploadTest.php index c6aa72f..7d5a1b3 100644 --- a/tests/Feature/DeferredUploadTest.php +++ b/tests/Feature/DeferredUploadTest.php @@ -21,6 +21,7 @@ test('it uploads a deferred file to a collection', function () { 'size' => 3028, 'file_name' => 'beispiel.pdf', 'mime_type' => 'application/pdf', + 'icon' => url('storage/filetypes/applicationpdf.svg'), ]); Storage::disk('temp')->assertExists('media-library/beispiel.pdf'); });