mostafaznv / nova-ckeditor

CkEditor 5 Field for Laravel Nova with Media & Snippet Browsers
https://mostafaznv.gitbook.io/nova-ckeditor/
MIT License
50 stars 21 forks source link

File options #31

Closed Brand3000 closed 1 year ago

Brand3000 commented 1 year ago

Hi! It'd be great to have the basic "storeAs" feature as well as others. Right now, I have to change the ImageStorage class from the vendor folder that is not a good idea. =/ The deletable method doesn't work as well. Actually, it's inconvenient not to have al the basic nova features =(

mostafaznv commented 1 year ago

Hi @Brand3000

Can you explain what do you want to do with storeAs?

Brand3000 commented 1 year ago
  1. storeAs In general, I don't think that creating random names is a good idea in terms of SEO reasons. If a seo specialist wants to promote some images of a website, they tend to name the files with keywords. However, I understand clearly that in order to prevent caching it's normal to make random names. So, my idea is to combine the both and I'm used to storing files like so: $hash = pathinfo($file->getClientOriginalName(), PATHINFOFILENAME) . "" . uniqid(); This way kills two birds in one stone =)
  2. deletion During the development process and uploading images often doesn't go well from one attempt. Sometimes I have to adjust sizes, format, etc. Without the deletion feature I have to delete the whole record. Then I have to put the name of the image again. I have to turn to the list of images, to find the name, go there, go here. Too complicated =(
mostafaznv commented 1 year ago

Hi @Brand3000

I developed a functionality to change naming method of images using config/nova-ckeditor.php file db2141e6d926379baecbcd2aacb865e8499c4027 for more information, please check the documentation.

And if you want more customization, you can use this functionality.

I will release this soon

mostafaznv commented 1 year ago

And about updating images: According to this part of documentation, update is disabled by default.

But you can enable it yourself. You can extend a class from Mostafaznv\NovaCkEditor\ImageUpload and use it in App\Nova\Resources\Image. So you can customize anything you want

mostafaznv commented 1 year ago

Please update the package to v3.2.1