The rich editor integration can store media ids again, with a file attachment provider that reads them.
Added
AttachCuratorMediaPlugin::make()->storeMediaIds()inserts library media with its key in the image'sdata-id, the attribute Filament uses for its own attachments. It's off by default; without it, inserted media stays a plain image as in 5.5. (#779)CuratorFileAttachmentProvider, which the plugin supplies when it stores media ids. It resolves each key to the media's current URL whenever the content is edited or rendered, so images follow replaced files and moved disks.- Only public media resolves, since the key comes from client content.
- Images uploaded, dropped or pasted into the editor are added to the library with the picker's checks (detected type, SVG sanitizing, size) and stored publicly.
- Its disk, directory, accepted types and maximum size can be set with
disk(),directory(),acceptedFileTypes()andmaxSize().
Uploader::storeUploadedFile()andUploader::isAcceptedFile()are now public.
Filament reads a provider from plugins only on a model's rich content attribute and in RichContentRenderer. An editor outside both, such as one in a nested form, needs the provider set on the field. See the rich editor docs.
Content saved before 5.5 with data-id attributes renders correctly again once storeMediaIds() is on.
What's Changed
Full Changelog: v5.5.5...v5.6.0