Replies: 4 comments 3 replies
-
I'd suggest a remberIf and a rememberUnless method. |
Beta Was this translation helpful? Give feedback.
-
Null values shouldn't be cached by default in Laravel. What version are you using? The remember function would execute the callback everytime if there is no key or value is null. |
Beta Was this translation helpful? Give feedback.
-
I have come across a similar scenario, where remembering For redis for example, we have the Adding a new cache method like |
Beta Was this translation helpful? Give feedback.
-
So, if any value has to be able to be returned, it doesn't matter, whether we change
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I recently embarked on a project refactoring task and stumbled upon a scenario where caching null values for a particular
remember
call wasn't beneficial. This sparked an idea to enhance the remember functionality in Laravel. I propose the following extensions:remember
only if the callback returns a non-null value.remember
to be conditioned on custom logic.These enhancements could be implemented either through a new method (for the first suggestion) or by introducing a new parameter to the existing
remember
method. What are your thoughts on this?Beta Was this translation helpful? Give feedback.
All reactions