Skip to content

Missing flushed cache event on Illuminate\Cache\TaggableStore #55101

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
cesarreyes3 opened this issue Mar 20, 2025 · 1 comment · Fixed by #55223 or #55405
Closed

Missing flushed cache event on Illuminate\Cache\TaggableStore #55101

cesarreyes3 opened this issue Mar 20, 2025 · 1 comment · Fixed by #55223 or #55405

Comments

@cesarreyes3
Copy link

cesarreyes3 commented Mar 20, 2025

Laravel Version

12

PHP Version

8.3

Database Driver & Version

MariaDB

Description

I'm capturing cache events, and everything's fine, but I notice no events are captured when flushing/clearing the cache. Is this intentional? It would be great to have that event available from Laravel.


12.x/src/Illuminate/Cache/Events

  • CacheHit
  • CacheMissed
  • ForgettingKey
  • KeyForgetFailed
  • KeyForgotten
  • KeyWriteFailed
  • KeyWritten
  • RetrievingKey
  • RetrievingManyKeys
  • WritingKey
  • WritingManyKeys

public function clear(): bool
{
return $this->store->flush();
}

public function flush()
{
return $this->memcached->flush();
}

Steps To Reproduce

$cache->tags(['tag_key'])->remember( // event dispatched
$cache->tags(['tag_key'])->forget(   // event dispatched
$cache->tags(['tag_key'])->flush();  // no event dispatched but it works 
@cesarreyes3 cesarreyes3 changed the title Mising flush cache event Missing flush cache event Mar 20, 2025
@crynobone crynobone linked a pull request Mar 21, 2025 that will close this issue
@cesarreyes3 cesarreyes3 changed the title Missing flush cache event Missing flushed cache event on Illuminate\Cache\TaggableStore Mar 24, 2025
@cesarreyes3
Copy link
Author

@crynobone PR #55157 still open, this is not completed,
try $cache->tags(['tag_key'])->flush(); // no event dispatched

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants