F
Filament2w ago
Hugo

Is it possible to display a different file name on FileUpload?

Hello. I am saving the original file names in a column and the filepath (with the random generated filename) in another column. Once the files have been uploaded, I'd like to know if there is any way to display the name instead of the random generated one. I am retrieving all the files the following way:
->formatStateUsing(fn($record) => $record !== null ? $record->justifications->pluck('path')->toArray() : null)
->formatStateUsing(fn($record) => $record !== null ? $record->justifications->pluck('path')->toArray() : null)
and the result, as expected is something like shown in the picture. I'd like to know if there is any way I can replace the file names (highlighted in the picture) by the ones in the "name" column.
No description
2 Replies
Want results from more Discord servers?
Add your server