Skip to content

Commit

Permalink
Merge branch '5.0-cache-events' of https://github.com/lucasmichot/lar…
Browse files Browse the repository at this point in the history
…avel-docs into lucasmichot-5.0-cache-events
  • Loading branch information
taylorotwell committed Mar 11, 2015
2 parents 5c55299 + 6ba6603 commit 523c0e4
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions cache.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,27 @@ In contrast, this statement would remove only caches tagged with `authors`, so "

Cache::tags('authors')->flush();

<a name="cache-events"></a>
## Cache events

Cache actions can trigger events. You may for instance use `Event` listeners to access the following events.

A cache entry exists and has been hit:

Event::listen('cache.hit', function($key, $value) { ... });

A cache entry has been asked but does not exist:

Event::listen('cache.missed', function($key) { ... });

A cache entry has been set or updated. `$minutes` will be equal to `0` if no expiration duration is set:

Event::listen('cache.write', function($key, $value, $minutes) { ... });

A cache entry has been deleted:

Event::listen('cache.delete', function($key) { ... });

<a name="database-cache"></a>
## Database Cache

Expand Down

0 comments on commit 523c0e4

Please sign in to comment.