PHP code example of d076 / laravel-cache-helper

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

    

d076 / laravel-cache-helper example snippets


use D076\LaravelCacheHelper\Traits\HasCached;

class SomeClass
{
    use HasCached;
    
    public function someMethod($params)
    {
        ...
    }
    
    public static function someStaticMethod($params)
    {
        ...
    }
}

$someClass->someMethodCached($params, $ttl);
$someClass->someMethodForceCached($params, $ttl);

SomeClass::someStaticMethodCached($params, $ttl);
SomeClass::someStaticMethodForceCached($params, $ttl);