Storing an Item in the Cache Forever


You want to store an item in the cache indefintely.


Use the Cache::forever() method.

This will permanently store the item.

Cache::forever($key, $value);


Clearing the cache will remove permanent items.

If you issue artisan cache:clear or call Cache::flush() then all items, including those stored with Cache::forever() will be removed.

comments powered by Disqus