my plugin “videobusinesscard” has in code
Event::listen('cms.template.processTwigContent', static function ($template, $content) {
$fullPath = $template->getFilePath();
$relativePath = str_replace(base_path(), '', $fullPath);
$relativePath = ltrim($relativePath, '/\\');
if ($relativePath === "plugins/konvertagency/landing/components/doctors/default.htm" or $relativePath === "plugins/konvertagency/mousetrackingphoto/components/mousetrackingphoto/default.htm") {
$content->content = str_replace(
"konvertagency.landing::make_data_and_certificates",
"konvertagency.videobusinesscard::make_data_and_certificates_video",
$content->content
);
}
});
it replaces a fragment in a twig template. The problem is that ‘cms.template.processTwigContent’ is processed only once after editing the template, and then this template is stored in the cache. If delete or disable my plugin, the modified template will remain in the cache.
Goal: run Artisan::call('cache:clear')
when disabling or deleting my plugin.