I know this discussion is a little old at this point but for anyone coming by for more information, I have to respectfully disagree with @starmatt. The array driver is not only meant for testing.
I find it is a perfectly acceptable way to store data that needs to persist for the current browser request only. This is useful when a set of data is going to be referenced multiple times per request (ie a single page hit) especially when that data is coming from external sources.
Further we use the array driver as a fallback when we give the application operators the ability to turn caching on and off. Something like:
if ($this->cacheEnabled) {
return cache()->store('redis')->remember($this->cacheId, $this->cacheMinutes, $callback);
} else {
return cache()->store('array')->rememberForever($this->cacheId, $callback);
}
In this scenario it's usually pretty safe to use the cache this way because the likelihood of the data changing in the few milliseconds the request is executing, but your milage may vary.
Hope this was helpful!