PHP code example of litermi / cache-query-builder

1. Go to this page and download the library: Download litermi/cache-query-builder 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/ */

    

litermi / cache-query-builder example snippets


'providers' => [
    // ...
    Litermi\Cache\Providers\ServiceProvider::class,
],

class Product extends CacheModel
{
}

        return Product::query()
            ->where('active', ModelConst::ENABLED)
            ->with($relations)
            ->getFromCache(['*'], $tags);

            $product = new Product();
            $product->saveWithCache();

            Product::insertWithCache($values);

            $product->deleteWithCache();
sh
php artisan vendor:publish --provider="Litermi\Cache\Providers\ServiceProvider"