Add icon path to deferred upload

This commit is contained in:
philipp lang 2024-01-13 21:49:17 +01:00
parent 3b8a129fa4
commit 91e5cc3e3b
2 changed files with 2 additions and 0 deletions

View File

@ -45,6 +45,7 @@ class DeferredMediaData extends Data
'size' => $file->getSize(), 'size' => $file->getSize(),
'file_name' => $file->getFilename(), 'file_name' => $file->getFilename(),
'mime_type' => $file->getMimeType(), 'mime_type' => $file->getMimeType(),
'icon' => Storage::disk('public')->url('filetypes/' . str()->slug($file->getMimeType()) . '.svg'),
]; ];
} }

View File

@ -21,6 +21,7 @@ test('it uploads a deferred file to a collection', function () {
'size' => 3028, 'size' => 3028,
'file_name' => 'beispiel.pdf', 'file_name' => 'beispiel.pdf',
'mime_type' => 'application/pdf', 'mime_type' => 'application/pdf',
'icon' => url('storage/filetypes/applicationpdf.svg'),
]); ]);
Storage::disk('temp')->assertExists('media-library/beispiel.pdf'); Storage::disk('temp')->assertExists('media-library/beispiel.pdf');
}); });