1. Go to this page and download the library: Download kai-init/laravel-normcache 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/ */
kai-init / laravel-normcache example snippets
use Illuminate\Database\Eloquent\Model;
use NormCache\Traits\Cacheable;
class Post extends Model
{
use Cacheable;
}
use Illuminate\Database\Eloquent\Model;
use NormCache\Traits\Cacheable;
class Post extends Model
{
use Cacheable;
protected static array $normCacheSpaces = ['content'];
}
class Author extends Model
{
use Cacheable;
protected static array $normCacheSpaces = ['content'];
}
Post::query()
->space('content')
->dependsOn([Author::class])
->get();