1. Go to this page and download the library: Download wuguofeng/webman-bouncer 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/ */
use Webman\Bouncer\Bouncer;
Bouncer::refresh($user); // 只清该用户的缓存(推荐,改动哪个用户就清哪个)
Bouncer::refresh(); // 清全部缓存(用户量大时较慢,慎用)
namespace app\model;
use Silber\Bouncer\Database\Concerns\Authorizable;
use Silber\Bouncer\Database\HasRolesAndAbilities;
use support\Model;
class User extends Model
{
use HasRolesAndAbilities;
use Authorizable;
}