classic-o / nova-media-library

Media Library for admin panel "Laravel Nova"
MIT License
157 stars 66 forks source link

How to save the filename in the model table instead the ID #75

Closed MaximeGraindor closed 3 years ago

MaximeGraindor commented 3 years ago

Hello! First of all, thank you for this work and this package!

I have a small question about the save in the database In the "Nova_media_library" table, the name is saved correctly while in my "photos" table, it's the id that is saved. So when I want to do "$album->photos[0]->path" I get the ID and not the name of the image.

Is it possible to get the file name instead of the image ID? Because when I want to display the path of the image, it does not necessarily find the image

Thanks again, this is exactly the package I needed!

2 Capture

classic-o commented 3 years ago

Hello. https://github.com/classic-o/nova-media-library#get-files-by-ids

MaximeGraindor commented 3 years ago

Alright, my bad, I'll pay more attention to the documentation next time! Sorry for the question and thanks!