Cache::getOrPut
#42907
-
Currently there are only Methods available either to get a Entry by key with a default Value, or to put a Value to the Cache. Example Code of this:
With a getOrPut Method in this Case, the Code above could looks like following:
Also it could be possible, to use a anonymous method as Closure to Generate the Cached Data. |
Beta Was this translation helpful? Give feedback.
Answered by
erikn69
Jun 22, 2022
Replies: 1 comment 1 reply
-
There are |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
hmennen90
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
There are
remember
andrememberForever
methods, just have to read documentation, that is the hard parthttps://laravel.com/docs/9.x/cache#retrieve-store