FBlog won't save post when TiptipEditor output is set to JSON.
I'm trying out the blog plugin for filament. I already had Tiptap editor installed and changed the config to save output as JSON.
This will result in an "array to string conversion" when trying to save the post. Added the
body
of the post to the $casts
as array solves it, but since the Post model resides in the vendor folder I can't edit this. Is there a way to work around this?3 Replies
Is it possible to change the $casts array via a model event? Like when it's booted for example
could cast the body to an array if a tiptap output in config is set to json, just have to find out how to do this π
I tried addin this to my AppServiceProvider:
It adds it to the casts array but does not resolve the issue
You'll need to override the model withy our own one that extends the original.
Or do a PR to the FBlog to allow setting your own Post Model Class like they have done for the user model class.
yea i thought so, i do wonder why overriding the casts on runtime does not work
thans for the reply!