You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-[Removing Items From the Cache](#removing-items-from-the-cache)
11
12
-[The Cache Helper](#the-cache-helper)
12
13
-[Atomic Locks](#atomic-locks)
@@ -287,6 +288,21 @@ The `add` method will only add the item to the cache if it does not already exis
287
288
Cache::add('key', 'value', $seconds);
288
289
```
289
290
291
+
<aname="extending-item-lifetime"></a>
292
+
### Extending Item Lifetime
293
+
294
+
The `touch` method allows you to extend the lifetime (TTL) of an existing cache item. The `touch` method will return `true` if the cache item exists and its expiration time was successfully extended. If the item does not exist in the cache, the method will return `false`:
295
+
296
+
```php
297
+
Cache::touch('key', 3600);
298
+
```
299
+
300
+
You may provide a `DateTimeInterface`, `DateInterval`, or `Carbon` instance to specify an exact expiration time:
0 commit comments