Laravel devs, did you know Cache::get accepts a closure as a fallback? π‘
It runs only if the key is missing
But it does not store the result in cache β
Use Cache::remember if you want to store it β
Back
β’
Lol how can I be this blind to ignore those green and red highlighting lines π³
Why would you use the closure on Get, when Remember does the same thing and then sets the cache? I use Remember all over my apps.
β’
Sometimes caching done wia webhook. And there is no way around it so you wanna do fall back logic if it doesn't exists.
It can be logging and returning default value etc.