Fresh code drop

Extend a cache item without reading it

PHP

Laravel 13 API example based on official Laravel documentation. Source: https://laravel.com/docs/13.x/cache#extending-item-lifetime

PHP
CodeSnap // free canvas

Extend a cache item without reading it

<?php

use Illuminate\Support\Facades\Cache;

$extended = Cache::touch(
    "checkout:{$cart->id}",
    now()->addMinutes(30),
);

// Further reading: https://laravel.com/docs/13.x/cache#extending-item-lifetime

Turn your code into a post.Five templates are free—no account needed.

Remix this snap