Incrementing the Value of an Item in the Cache


You want to increment a value in the cache.


Use Cache::increment()

$value = Cache::increment('key');

The first time this is called $value will be 1, the next call it will return 2, and so forth.

You can also pass a value to increment.

$value = Cache::increment('key', 50);


Doesn't work with File or Database caches.

comments powered by Disqus