FilamentF
Filament2y ago
TK

getUploadedFileNameForStorageUsing() on FileUpload::configureUsing() does not work :S

Using ->getUploadedFileNameForStorageUsing() when defining defaults for file uploads, does not work.

So, doing this inside the
AppServiceProvider
does not work:
namespace App\Providers;

FileUpload::configureUsing(function (FileUpload $component): void {
    $component->getUploadedFileNameForStorageUsing(
        function (TemporaryUploadedFile $file): string {
             ...
        },
    );
});


Not sure why this specifically is for ->getUploadedFileNameForStorageUsing(). I think it would be nice defining a default way files are stored globally, instead of doing this on all FileUpload::make() everywhere.

Note, using the exact same function on Fileupload::make()->getUploadedFileNameForStorageUsing(), does work!

Anyone got an idea? Is this a bug?
Was this page helpful?