Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Ringhoo opened this issue Nov 1, 2024 · 0 comments
Open

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

Ringhoo opened this issue Nov 1, 2024 · 0 comments

Comments

@Ringhoo
Copy link

Ringhoo commented Nov 1, 2024

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant