Add a cache every time you update your data
$yourData = ...; // Your logic of getting your data
Cache::forever('your-key', $yourData);
You need to handle when you store your new values yourself.
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
i want to Cache my data and if i change my value in database than cache will automatically update and if not change than not query in database and return data to Cache.
suppose i Cache my data [1,2,3,4] this array after 5 minutes i update my data [1,2,3,4,5,6] now how i get my latest update data .
note: if data is update than only query database if not change not query to database.
Please or to participate in this conversation.