PHP code example of laravel-enso / cache-chain

1. Go to this page and download the library: Download laravel-enso/cache-chain library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

laravel-enso / cache-chain example snippets


'stores' => [
    'chain' => [
        'driver' => 'chain',
        'providers' => ['array', 'redis', 'file'],
        'defaultTTL' => 300,
    ],
],

use Illuminate\Support\Facades\Cache;

$cache = Cache::store('chain');

$cache->put('settings.theme', 'dark', 300);

$theme = $cache->get('settings.theme');

$cache = Cache::store('chain');

$cache->put('visits', 10, 300);

$cache->increment('visits', 5);