<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
salehhashemi / laravel-configurable-cache example snippets
use Salehhashemi\ConfigurableCache\ConfigurableCache;
// Storing an item in the cache with `_tiny_` prefix for 15 minutes
ConfigurableCache::put('testKey', 'Hello World!', 'tiny');
// Retrieving an item from the cache with `_short_` prefix that is stored for an hour
$value = ConfigurableCache::get('testKey', 'short');
// Delete a cache item with `_otp_` prefix
ConfigurableCache::delete('testKey', 'otp');
// if `testKey` doesn't exist in the 'default' cache, the Closure will be executed and its result will be stored in the cache under `testKey` with `_default_` prefix
$value = ConfigurableCache::remember('testKey', function () {
return 'Hello World!';
});