RichEditor content is ignored
I have a simple schema:
When I save this I got an QueryException because the rich editor field (body) is missing:
If I replace the RichEditor with a Textarea field without any other changes it workes.
Solution:Jump to solution
ok, wow. I solved it. The body column has to be nullable even the field is required - This is mentioned in the filament spatie media library documention but can easily be overlooked here: https://filamentphp.com/plugins/filament-spatie-media-library#using-media-library-for-rich-editor-file-attachments
Using SpatieMediaLibraryFileAttachmentProvider requires that the rich content attribute (content in this example) must be defined as nullable in database....
Filament
Spatie Media Library by Filament - Filament
Filament support for Spatie's Laravel Media Library package.
2 Replies
Oh, it has something to do with the media handling.
The rich editor works if I remove
from the model. But I want to handle the media via Spatie Media Library
Solution
ok, wow. I solved it. The body column has to be nullable even the field is required - This is mentioned in the filament spatie media library documention but can easily be overlooked here: https://filamentphp.com/plugins/filament-spatie-media-library#using-media-library-for-rich-editor-file-attachments
Using SpatieMediaLibraryFileAttachmentProvider requires that the rich content attribute (content in this example) must be defined as nullable in database.
Filament
Spatie Media Library by Filament - Filament
Filament support for Spatie's Laravel Media Library package.