diff --git a/src/Illuminate/Cache/SessionStore.php b/src/Illuminate/Cache/SessionStore.php index 0ed5a4da0609..251e5900eec6 100644 --- a/src/Illuminate/Cache/SessionStore.php +++ b/src/Illuminate/Cache/SessionStore.php @@ -194,6 +194,24 @@ public function itemKey($key) return "{$this->key}.{$key}"; } + /** + * Adjust the expiration time of a cached item. + * + * @param string $key + * @param int $seconds + * @return bool + */ + public function touch($key, $seconds) + { + if (! $this->session->exists($this->itemKey($key))) { + return; + } + + $item = $this->session->get($this->itemKey($key)); + + return $this->put($key, $item['value'], (int) max(1, $seconds)); + } + /** * Get the cache key prefix. *