use Padosoft\SuperCacheInvalidate\Helpers\SuperCacheInvalidationHelper;
$helper = app(Padosoft\SuperCacheInvalidate\Helpers\SuperCacheInvalidationHelper::class);
// Invalidate a tag
$helper->insertInvalidationEvent('tag', 'category:sport', 'cache', 'Product updated in category sport');
// Invalidate a key
$helper->insertInvalidationEvent('key', 'cache_key_xyz', 'fullpage-cache', 'Specific cache key invalidated');
// Invalidate a key with associated tags
// In this example, when the event for article_ID:7 is processed,
// it will also consider plp:sport during invalidation.
// If plp:sport is within its invalidation window, the invalidation of article_ID:7
// will be deferred to ensure consistency.
$helper->insertInvalidationEvent(
'tag',
'article_ID:7',
'fullpage-cache',
'Article 7 removed from sale',
0,
0,
[
['type' => 'tag', 'identifier' => 'plp:sport', 'connection_name' => 'cache']
]
);