Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Matt Stauffer:
The new cache() global helper in Laravel 5.3
Jul 08, 2016 @ 16:11:28

Matt Stauffer has continued his series covering some of the new features in Laravel v5.3 with this look at the cache helper, a new feature introduced to help make working with your cached data easier.

As I was writing my book I noticed a pattern in the global helper functions like session() and, in some ways, cookie(). There are three primary functions that they can perform: get a value, put a value, or return an instance of their backing service.

[...] I mentioned that it seems like there should be a cache() helper, and before I could even think much more about it, Jeffrey (Way) had already written one up. So! Behold! The global cache() helper, new in Laravel 5.3.

He includes code samples showing the helper in action. It's a simplified helper so the main functionality is basically the same as the session and cookie helpers: read, write and return an instance of the CacheManager.

tagged: cache global helper laravel cachemanager overview

Link: https://mattstauffer.co/blog/the-new-cache-global-helper-in-laravel-5-3


Trending Topics: