PHP code example of sunchayn / strata

1. Go to this page and download the library: Download sunchayn/strata 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/ */

    

sunchayn / strata example snippets


'stores' => [
    'strata' => [
        'driver' => 'strata',
    ],
],

use Illuminate\Support\Facades\Cache;

Cache::store('strata')->put('user:1', $user, 600);
Cache::store('strata')->get('user:1');
Cache::store('strata')->forget('user:1');

Cache::store('strata')->tags(['books', 'catalog'])->put('books:1', $book, 600);

Cache::store('strata')->get('books:1');

Cache::store('strata')->tags(['books'])->flush();

use Illuminate\Support\Facades\Schedule;

Schedule::command('strata:prune-stale-tags')->daily();

Cache::store('strata')->lock('import', 10)->get(function () {
    // ...
});

Cache::store('strata')->increment('views');
Cache::store('strata')->decrement('stock', 5);
bash
php artisan vendor:publish --tag="strata-config"