F
Filament11mo ago
Welzh

How to customize the url FileUpload uses to fetch a file

Im using Stancl's multitenancy and in the tenant filament enviroment, I have some file upload for images, the uploads I got working, but the preview url gets loaded with the default asset() functionality, can I customize this to use a different way to fetch the files? example: tenant_asset($state) Current url: http://domain.test/storage/01HNT1WMJ3667RZ48B31BD94EV.png Desired url: http://domain.test/tenancy/assets/01HNT1WMJ3667RZ48B31BD94EV.png
3 Replies
Welzh
WelzhOP11mo ago
Ive tried the following:
FileUpload::make('logo')
->getUploadedFileUsing(function($file){
return tenant_asset($file);
}),
FileUpload::make('logo')
->getUploadedFileUsing(function($file){
return tenant_asset($file);
}),
Only this seems to return [Object object], even though the output is the correct URL
Wannes
Wannes9mo ago
Did you figure this out?
Dennis Koch
Dennis Koch9mo ago
Maybe open a new thread with your issue and add some information
Want results from more Discord servers?
Add your server