awcodes / filament-tiptap-editor

A Rich Text Editor plugin for Filament Forms.
MIT License
249 stars 64 forks source link

Adds action to store media using spatie/laravel-medialibrary #424

Open core45 opened 3 days ago

core45 commented 3 days ago

Purpose

By default, the media files are stored in the public disk in the media directory.

This adds the possibility to store media using spatie/laravel-medialibrary package. The user will need to change the media_action key in the config file filament-tiptap-editor.php to SpatieMediaLibraryAction:

core45 commented 2 days ago

Good points. Thank you. I'll correct the ck-media thing and add alt etc

core45 commented 23 hours ago

I fixed the ck-media mistake.

Concerning the alt, title and dimensions there is no need to implement anything using spatie/laravel-medialibrary because those parameters are stored in the text itself as the attributes eg. like this:

<img src="/storage/11/conversions/29e032e5-06b5-43cf-867c-80f33809801d-large.webp" alt="Alt Text" title="The photo title" width="1280" height="853" loading="lazy">

Is this OK?

awcodes commented 2 hours ago

Wondering if this needs to be in the plugin itself? Seems like if could just be a Class in the app, since it can still be changed via the config.