Skip to content

Display files in nova using their names instead of filenames #449

@Ringhoo

Description

@Ringhoo

Hi, I have the following field in laravel nova resource:

Files::make(__('Files'), 'downloadable')
  ->setFileName(function ($originalFilename, $extension, $model) {
      return Str::slug($model->name) . '-' . md5($originalFilename) . '.' . $extension;
  })
  ->singleMediaRules(['max:'.$maxfilesize]),

It is working fine, however the field is displaying all files using their filename, which I just modified to a md5 hash, as shown on the image below.

Screenshot 2024-11-01 at 14 37 47

It is not very friendly for a user. So my question is, is it possible to display the files using their name instead of the filename?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions