PHP code example of plug2team / model-cacheable
1. Go to this page and download the library: Download plug2team/model-cacheable 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/ */
plug2team / model-cacheable example snippets
namespace App;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Plug2Team\ModelCached\Concerns\Cacheable;
class User extends Authenticatable
{
use Cacheable;
public function boot() {
\App\User::crape();
}
$schedule->command('cacheable:flush')->cron(config('model_cached.commands.flush'));
$schedule->command('cacheable:reindex')->cron(config('model_cached.commands.re_index'));
$users = \App\User::cache('all');