preg_replace
$post = Post::published->whereSlug($slug)->firstOrFail();$regex = '/<a[^>]*>(<img[^>]*>).*?<figcaption[^>]*>.*?<\/figcaption>.*?<\/a>/is';$post->content = preg_replace($regex, '$1', $post->content);