Laravel - Cache - Removing Tagged Cache Items
You may flush all items that are assigned a tag or list of tags. For example, this statement would remove all caches tagged with either people
, authors
, or both. So, both Anne
and John
would be removed from the cache:
Cache::tags(['people', 'authors'])->flush();
In contrast, this statement would remove only cached values tagged with authors
, so Anne
would be removed, but not John
:
Cache::tags('authors')->flush();