Bruno Meilick

Lapse

Cache any data until the set expiration time

$keyFromObjects = [$page, $page->files()];
$data = lapse(
    $keyFromObjects, // will check modified
    function () use ($page) {
        return $page->files()->toArray(
          fn ($file) => $file->niceSize()
        );
    }
); // expires when any timestamp changes
Version
4.0.1
License
MIT
Stars
18
Supports
K4 K3
Implements
More