PHP code example of sanchescom / laravel-cache-memory

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

    

sanchescom / laravel-cache-memory example snippets


'providers' => [
    ...
    Sanchescom\Cache\MemoryServiceProvider::class,
],

$app->register(Sanchescom\Cache\MemoryServiceProvider::class);

    'memory' => [
        'driver' => 'memory',
        'key' => env('MEMORY_BLOCK_KEY', 1),
        'size' => env('MEMORY_BLOCK_SIZE', 900000),
    ],



use Illuminate\Support\Facades\Cache;

Cache::store('memory')->put('some_key', ['value' => 'text']);



use Illuminate\Support\Facades\Cache;

$data = Cache::store('memory')->get('some_key');

// the deletion will be managed by the OS kernel , and will happen at a future time
Cache::store('memory')->getStore()->requestDeletion();