PHP code example of faveo-helpdesk / laravel-cache

1. Go to this page and download the library: Download faveo-helpdesk/laravel-cache 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/ */

    

faveo-helpdesk / laravel-cache example snippets



composer 


php artisan vendor:pubish --force --tag=advance-cache


use CacheDriver\HandleCacheController;

$cache = new HandleCacheController();

// Store file driver
$cache->modify(['DEFAULT' => 'file']);

// Store database driver
$cache->modify(['DEFAULT' => 'database']);

// Store array driver
$cache->modify(['DEFAULT' => 'array']);

// Store redis driver
$cache->modify(['DEFAULT' => 'redis', 'CONNECTION_REDIS' => 'default']);

// Store memcached driver
$cache->modify(['DEFAULT' => 'memcached', 'MEMCACHED_HOST' => '', 'MEMCACHED_PORT' => '', 'MEMCACHED_PERSISTENT_ID' => '', 'MEMCACHED_USERNAME' => '', 'MEMCACHED_PASSWORD' => '']);

// Store dynamodb driver
$cache->modify(['DEFAULT' => 'dynamodb', 'AWS_ACCESS_KEY_ID' => '', 'AWS_SECRET_ACCESS_KEY' => '', 'AWS_DEFAULT_REGION' => '', 'DYNAMODB_CACHE_TABLE' => '', 'DYNAMODB_ENDPOINT' => '']);

use CacheDriver\HandleCacheController;

$cache = new HandleCacheController();

// Gets a default driver. If constant was not there, 'database' value will be picked. Not only DEFAULT constant but also serach all kind of cache Constant value
$cache::value('DEFAULT', 'database');

use CacheDriver\HandleCacheController;

$cache = new HandleCacheController();

// Passes a driver like file, database, array, redis, memcached and dynamodb
$cache::all('file');