farid
farid
FFilament
Created by farid on 7/9/2024 in #❓┊help
How to prevent RichEditor from storing an attached image with a default caption and a link to it?
Thank you Leandro! Just for everyone reference I tell you that I suppress unwanted data in frontend view using preg_replace in my controller just like:
$post = Post::published->whereSlug($slug)->firstOrFail();
$regex = '/<a[^>]*>(<img[^>]*>).*?<figcaption[^>]*>.*?<\/figcaption>.*?<\/a>/is';
$post->content = preg_replace($regex, '$1', $post->content);
$post = Post::published->whereSlug($slug)->firstOrFail();
$regex = '/<a[^>]*>(<img[^>]*>).*?<figcaption[^>]*>.*?<\/figcaption>.*?<\/a>/is';
$post->content = preg_replace($regex, '$1', $post->content);
5 replies