1. Go to this page and download the library: Download erjon/laravel-cache-groups 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/ */
use Illuminate\Support\Facades\Cache;
// Store a value in a group
Cache::groups(['products'])->put('item:1', $product, 3600);
// Retrieve a value
$product = Cache::groups(['products'])->get('item:1');
// Store with multiple groups
Cache::groups(['products', 'featured'])->put('item:1', $product, 3600);
// Flush all items in a group
Cache::groups(['products'])->flush();