Add icon path to deferred upload
This commit is contained in:
parent
3b8a129fa4
commit
91e5cc3e3b
|
@ -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'),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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');
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue